Commit Graph

10032 Commits

Author SHA1 Message Date
Laura Brehm 986b077a53
Merge pull request #5361 from laurazard/add-oauth-login-escape-hatch
login: add oauth escape hatch
2024-08-20 12:31:07 +01:00
Laura Brehm a327476f7f
login: add e2e tests for oauth + escape hatch
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-20 11:49:04 +01:00
Laura Brehm 846ecf59ff
login: add oauth escape hatch
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-20 11:16:55 +01:00
David Karlsson 0be9e2faaa
Merge pull request #5347 from dvdksn/update-build-context-link
docs: update link to moved build context doc
2024-08-19 13:13:31 +02:00
Laura Brehm b06db58d8d
Merge pull request #5356 from vvoland/list-tree-gd-spacing
list/tree: No extra spacing for graphdriver
2024-08-19 11:46:07 +01:00
Paweł Gronowski 7b91647943
list/tree: No extra spacing for graphdriver
Don't output the extra spacing around the images when none of the
top-level image entries has any children.

This makes the list look better when ran against the graphdrivers image
store.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-19 12:09:37 +02:00
Paweł Gronowski 8675f4c177
Merge pull request #5352 from vvoland/c8d-multiplatform-list-2
list/tree: Print <untagged> as dangling image name
2024-08-16 16:56:08 +02:00
Paweł Gronowski 351249dce9
list/tree: Print <untagged> as dangling image name
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 16:36:33 +02:00
Paweł Gronowski 6979ab073c
list/tree: Fix some escape codes included in nonTTY
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 16:35:46 +02:00
Laura Brehm cab8a2e830
Merge pull request #4982 from vvoland/c8d-multiplatform-list
image/list: Add `--tree` flag
2024-08-16 14:27:15 +01:00
Paweł Gronowski a9b78da546
list/tree: Add spacing before the content and first image
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 15:10:00 +02:00
Paweł Gronowski 0242a1e3c6
list/tree: Capitalize column headers
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 15:09:59 +02:00
Paweł Gronowski d417d06682
list/tree: Add an experimental warning
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 15:09:57 +02:00
Paweł Gronowski b1a08f7841
list/tree: Sort by created date
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 15:09:55 +02:00
Paweł Gronowski 18ab78882c
list/tree: Align number right, text left
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 15:09:54 +02:00
Paweł Gronowski ea8aafcd9e
cli/tree: Add `Content size` column
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 15:09:52 +02:00
Paweł Gronowski be11b74ee9
image/list: Add `--tree` flag
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-16 15:09:51 +02:00
Sebastiaan van Stijn bbce5a0afa
Merge pull request #5344 from laurazard/auth-device-flow-pat
auth: add support for oauth device-code login
2024-08-15 09:29:45 +02:00
Laura Brehm c3fe7bc336
fallback to regular login if oauth login fails to start
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-14 19:48:09 +01:00
Laura Brehm 5eb3275c28
filestore: don't print warning multiple times
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-14 19:48:08 +01:00
Laura Brehm e6624676e0
login: normalize `registry-1.docker.io`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-14 19:48:07 +01:00
Laura Brehm 6e4818e7d6
Refactor `cli/command/registry`
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-14 19:48:05 +01:00
Laura Brehm fcfdd7b91f
auth: add support for oauth device-code login
This commit adds support for the oauth [device-code](https://auth0.com/docs/get-started/authentication-and-authorization-flow/device-authorization-flow)
login flow when authenticating against the official registry.

This is achieved by adding `cli/internal/oauth`, which contains code to manage
interacting with the Docker OAuth tenant (`login.docker.com`), including launching
the device-code flow, refreshing access using the refresh-token, and logging out.

The `OAuthManager` introduced here is also made available through the `command.Cli`
interface method `OAuthManager()`.

In order to maintain compatibility with any clients manually accessing
the credentials through `~/.docker/config.json` or via credential
helpers, the added `OAuthManager` uses the retrieved access token to
automatically generate a PAT with Hub, and store that in the
credentials.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-14 19:48:04 +01:00
David Karlsson 2dd4eb06ae docs: update link to moved build context doc
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-08-13 11:48:29 +02:00
Sebastiaan van Stijn 35666cf7cb
Merge pull request #5345 from thaJeztah/connhelper_cleanups
cli/connhelper: getConnectionHelper: move ssh-option funcs out of closure
2024-08-13 11:38:44 +02:00
Sebastiaan van Stijn 0fd3fb0840
cli/connhelper: getConnectionHelper: move ssh-option funcs out of closure
The addSSHTimeout and disablePseudoTerminalAllocation were added in commits
a5ebe2282a and f3c2c26b10,
and called inside the Dialer function, which means they're called every
time the Dialer is called. Given that the sshFlags slice is not mutated
by the Dialer, we can call these functions once.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-12 17:28:32 +02:00
Sebastiaan van Stijn 1a7b7dd7dd
Merge pull request #5320 from trajano/patch-1
disable pseudoterminal creation
2024-08-12 16:59:47 +02:00
Archimedes Trajano f3c2c26b10
disable pseudoterminal creation
avoided the join, also did manual iteration

added test, also added reflect for the DeepEqual comparison

Signed-off-by: Archimedes Trajano <developer@trajano.net>
2024-08-12 16:53:49 +02:00
David Karlsson 211a5403b3
Merge pull request #5342 from dvdksn/docs-update-internal-links
docs: update internal links after refactor
2024-08-12 10:10:05 +02:00
David Karlsson d4a362aa1c docs: update internal links after refactor
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-08-11 16:58:08 +02:00
Sebastiaan van Stijn 471862b122
Merge pull request #5323 from jongwu/fix_bps_limit
run: fix GetList return empty issue for throttledevice
2024-08-09 19:46:23 +02:00
David Karlsson fc3e949a66
Merge pull request #5338 from dvdksn/fix-proxy-doclink
docs: fix link to http proxy document
2024-08-09 19:11:04 +02:00
David Karlsson 78a8fba2cc docs: fix link to http proxy document
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-08-09 18:19:58 +02:00
Paweł Gronowski c537fb9f48
Merge pull request #5332 from thaJeztah/bump_engine
vendor: github.com/docker/docker 2269acc7a31d (master, v-next)
2024-08-09 09:45:24 +02:00
Sebastiaan van Stijn 6440816c7c
vendor: github.com/docker/docker 2269acc7a31d (master, v-next)
removes (indirect) dependencie on the moby/sys/user/userns package, which
was retracted and moved to moby/sys/userns

- full diff: f3cf9359bd...2269acc7a3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-08 13:37:58 +02:00
Sebastiaan van Stijn 7fc8802889
Merge pull request #5330 from vvoland/vendor-docker-master
vendor: github.com/docker/docker master  (f3cf9359bdf6)
2024-08-08 12:09:30 +02:00
Paweł Gronowski 91b173e69f
Merge pull request #5316 from thaJeztah/add_security
add security policy
2024-08-08 11:48:43 +02:00
Paweł Gronowski b8a53ee340
vendor: github.com/docker/docker master (f3cf9359bdf6)
full diff: 2b1097f080...f3cf9359bd

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-08 11:44:02 +02:00
Sebastiaan van Stijn 0052d2ce05
Merge pull request #5327 from laurazard/fix-panic-pluginserver
plugins: don't panic on Close if PluginServer nil
2024-08-07 17:16:00 +02:00
Laura Brehm 9c4480604e
plugins: don't panic on Close if PluginServer nil
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-08-07 14:04:31 +01:00
Sebastiaan van Stijn 87c6624cb7
Merge pull request #5324 from vvoland/update-go-1.21.13
update to go1.21.13
2024-08-07 12:01:32 +02:00
Paweł Gronowski 434d8b75e8
update to go1.21.13
- https://github.com/golang/go/issues?q=milestone%3AGo1.21.13+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.21.12...go1.21.13

go1.21.13 (released 2024-08-06) includes fixes to the go command, the
covdata command, and the bytes package. See the [Go 1.21.13 milestone](https://github.com/golang/go/issues?q=milestone%3AGo1.21.13+label%3ACherryPickApproved)
on our issue tracker for details.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-08-07 11:49:40 +02:00
Jianyong Wu 73e78a5822 run: fix GetList return empty issue for throttledevice
Test "--device-read-bps" "--device-write-bps" will fail. The root
cause is that GetList helper return empty as its local variable
initialized to zero size.

This patch fix it by setting the related slice size to non-zero.

Signed-off-by: Jianyong Wu <wujianyong@hygon.cn>
Fixes: #5321
2024-08-07 02:48:39 +00:00
Sebastiaan van Stijn e29292f921
add security policy
Based on the security policy in the Moby repository (with the name
of the project changed, and a link to to the Moby documentation for
maintained branches).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-08-05 11:58:34 +02:00
Laura Brehm 78de7da660
Merge pull request #5310 from thaJeztah/gha_permissions
gha: set permissions to read-only by default
2024-08-02 11:26:06 +01:00
Laura Brehm 93ee2e6638
Merge pull request #5311 from thaJeztah/vendor_otel_trace
vendor: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0
2024-08-02 11:25:20 +01:00
Sebastiaan van Stijn 40a5b297b6
vendor: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0
commit 89db01ef97 added these tracing modules
as dependency, but did not require the otlptracehttp module. This module
was added later through f0a29af0f3 as indirect
dependency for docker/docker. The otlptracehttp and otlptracegrpc modules
have no dependency between each-other, but similar to their otlpmetric
cousins, are preferred to be on the same version.

This patch aligns their versions. No changes in vendored code;

full diff: https://github.com/open-telemetry/opentelemetry-go/compare/exporters/otlp/otlptrace/otlptracehttp/v1.19.0...exporters/otlp/otlptrace/otlptracehttp/v1.21.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-31 22:28:36 +02:00
Sebastiaan van Stijn e4d99b4b60
gha: set permissions to read-only by default
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-07-31 14:19:02 +02:00
Laura Brehm ddd4c39930
Merge pull request #5303 from laurazard/fix-flaky-runattach-test
tests/run: fix flaky `RunAttachTermination` test
2024-07-29 13:43:31 +01:00
Laura Brehm eac83574c1
tests/run: fix flaky `RunAttachTermination` test
This test was just incorrect (and testing incorrect
behavior): it was checking that `docker run` exited with a `context
canceled` error after signalling the CLI/cancelling the command's
context, but this was incorrect (and was fixed in
991b1303da - which was when this test
started failing).

However, since this test assertion was happening inside of a goroutine,
it would sometimes pass if this assertion didn't get to run before the
test suite terminated. It was flaky because sometimes this assertion
inside the goroutine did get to execute, but after the test finished
execution, which is a big no-no.

As an aside, assertions inside goroutines are generally bad, and `govet`
even has a linter for this (but it only catches `t.Fatal` and `t.FailNow`
calls and not `assert.Xx`.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2024-07-29 13:29:12 +01:00