Commit Graph

10846 Commits

Author SHA1 Message Date
fdcfd229aa cli-plugins/manager: rename var that shadowed arg in test
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-18 12:10:38 +01:00
abd02b6a23 cli-plugins/manager: ListPlugins: pass context to error-group
This error-group was added in 89583b92b7, but
passed a context.TODO because the function didn't have a context as argument.

However, it does get the root-command passed, which holds the context, so
we can pass that.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-18 12:10:28 +01:00
2d74733942 Merge pull request #5869 from thaJeztah/bump_crypto
vendor: golang.org/x/crypto v0.35.0
2025-03-11 10:10:04 +01:00
d421dea843 Merge pull request #5908 from thaJeztah/client_api_version
remove uses of cli.DefaultVersion()
2025-03-11 10:07:31 +01:00
4bdfd3b684 vendor: golang.org/x/crypto v0.35.0
We have tagged version v0.35.0 of golang.org/x/crypto in order to address
a security issue. Version v0.35.0 of golang.org/x/crypto fixes a vulnerability
in the golang.org/x/crypto/ssh package which could cause a denial of service.
SSH servers which implement file transfer protocols are vulnerable to a denial
of service attack from clients which complete the key exchange slowly, or not
at all, causing pending content to be read into memory, but never transmitted.
Thanks to Yuichi Watanabe for reporting this issue.
This is CVE-2025-22869 and Go issue https://go.dev/issue/71931.

full diff: https://github.com/golang/crypto/compare/v0.31.0...v0.35.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 20:04:11 +01:00
09caaa312d vendor: golang.org/x/crypto v0.34.0
No code-changes, but updates the minimum go version to go1.23:

> all: upgrade go directive to at least 1.23.0 [generated]
>
> By now Go 1.24.0 has been released, and Go 1.22 is no longer supported
> per the Go Release Policy (https://go.dev/doc/devel/release#policy).
>
> For golang/go#69095.

full diff: https://github.com/golang/crypto/compare/v0.31.0...v0.34.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 20:04:11 +01:00
4dfe7ad85e vendor: golang.org/x/text v0.22.0
no code-changes in vendored files.

full diff: https://github.com/golang/text/compare/v0.21.0...v0.22.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 20:04:11 +01:00
3cdc44568d vendor: golang.org/x/sync v0.11.0
no code-changes, only a godoc comment updated

full diff: https://github.com/golang/sync/compare/v0.10.0...v0.11.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 20:04:11 +01:00
19ce7f2eaf vendor: golang.org/x/sys v0.30.0
full diff: https://github.com/golang/sys/compare/v0.29.0...v0.30.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 20:04:10 +01:00
1673cd88a8 Merge pull request #5920 from thaJeztah/vendor_min_go_version
vendor.mod: update minimum go version to go1.23
2025-03-10 20:03:11 +01:00
a9e6180cd8 vendor.mod: update minimum go version to go1.23
Go maintainers started to unconditionally update the minimum go version
for golang.org/x/ dependencies to go1.23, which means that we'll no longer
be able to support any version below that when updating those dependencies;

> all: upgrade go directive to at least 1.23.0 [generated]
>
> By now Go 1.24.0 has been released, and Go 1.22 is no longer supported
> per the Go Release Policy (https://go.dev/doc/devel/release#policy).
>
> For golang/go#69095.

This updates our minimum version to go1.23, as we won't be able to maintain
compatibility with older versions because of the above.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 18:29:49 +01:00
3d3f78028a Merge pull request #5919 from thaJeztah/no_generics
cli/command/formatter: add missing go:build tag
2025-03-10 18:18:06 +01:00
64b56179b5 Merge pull request #5907 from thaJeztah/opts_cleanup
opts: remove uses pkg/errors, and move swarm-specific opts to a separate package
2025-03-10 18:03:49 +01:00
29c1ababd7 Merge pull request #5903 from thaJeztah/cli_plugins_no_pkg_errors
cli-plugins/manager: use stdlib errors, and minor cleanup
2025-03-10 18:02:58 +01:00
2cd4786630 cli/command/formatter: add missing go:build tag
Seen failing when used elsewhere;

    vendor/github.com/docker/cli/cli/command/formatter/displayutils.go:78:20: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-10 17:39:06 +01:00
571124d4b0 Merge pull request #5909 from thaJeztah/move_winresources
move winresources into cmd/docker
2025-03-10 16:30:38 +01:00
60ae1bb1fc Merge pull request #5910 from thaJeztah/move_service_logs
service/logs: move to cli/internal/logdetails
2025-03-10 16:14:22 +01:00
879acd15ff Merge pull request #5911 from thaJeztah/builder_nits
cli/command/image: fix some minor linting issues
2025-03-10 16:12:24 +01:00
a07391c65d Merge pull request #5906 from thaJeztah/remove_client_warnings
fix duplicate warnings on docker run / docker create, and slight refactor
2025-03-10 16:03:38 +01:00
650b45a42a Merge pull request #5915 from thaJeztah/remove_StringSliceReplaceAt
cli/command: remove StringSliceReplaceAt utility
2025-03-10 13:37:31 +01:00
bc57a035c4 Merge pull request #5916 from thaJeztah/move_command_prettyprint
cli/command: move PrettyPrint utility to cli/command/formatter
2025-03-10 13:35:03 +01:00
a390a32da1 Merge pull request #5917 from thaJeztah/prunefilters_shallow_interface
cli/command: PruneFilters: require smaller interface
2025-03-10 13:33:00 +01:00
70bf6cb7c5 Merge pull request #5863 from Benehiko/only-experimental-workflow
workflow/e2e: only run experimental daemon
2025-03-10 13:32:13 +01:00
e9cf371b56 Merge pull request #5913 from thaJeztah/image_load_cleanup
image load: combine checks to a single switch
2025-03-10 11:54:30 +00:00
c26090bd3e workflow/e2e: only run experimental daemon
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
2025-03-10 12:26:20 +01:00
7ec69def79 Merge pull request #5904 from thaJeztah/cleanup_buildtags
remove legacy build-tags
2025-03-10 11:41:58 +01:00
d2b751ce58 cli/command: PruneFilters: require smaller interface
This function only needs access to the CLI's configfile; use the
config.Prider interface to be more clear on what's expected.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-09 22:30:05 +01:00
a5ec6c2963 cli/command: remove StringSliceReplaceAt utility
It was only used internally in cmd/docker and has no known external
consumers. Move it to cmd/docker and un-export it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-09 22:22:29 +01:00
ce3090ccc4 cli/command: move PrettyPrint utility to cli/command/formatter
This utility was only used internally, and has no external consumers;
move it to the "formatter" package, which is also imported in all files
using this utility.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-09 22:20:12 +01:00
802d8e801a image load: combine checks to a single switch
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-09 14:43:57 +01:00
6bd6b3e8ac service/logs: move to cli/internal/logdetails
This package is only used by cli/command/service, and has no
external consumers.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 22:51:11 +01:00
2c0f9f476d cli/command/image: explicitly ignore some unhandled errs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 22:47:56 +01:00
e73fb7d2f6 cli/command/image: rename var that shadowed type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 22:43:21 +01:00
1bd58b0936 service/logs: remove pkg/errors, and minor cleanups
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 22:23:18 +01:00
44e5100232 move winresources into cmd/docker
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 22:20:09 +01:00
79c9c7e3e4 cli/command/system: ignore unhandled errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 19:32:35 +01:00
5f13d0f2b5 remove uses of cli.DefaultVersion()
It's hard-coded to the API defaultversion, so we can use
that const directly. Ultimately, this should be something
returned by the API client configured on the CLI, not the
CLI itself.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 19:32:31 +01:00
d0d91bb0cd opts/swarmopts: remove redundant import aliases
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 18:39:12 +01:00
ad21055bac opts: move swarm-specific options to a separate package
This prevents users of the CLI that don't implement swarm-related
features from depending on the swarm API types.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 18:39:07 +01:00
4c882e0f6c opts: use stdlib errors and touch-up some errors
- remove uses of github.com/pkg/errors
- slight improvement on handling parsing errors
- add some test-cases

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 18:15:51 +01:00
bc90bb6855 container create: combine client-side warning with daemon-side
Use a consistent approach for producing warnings, but add a TODO for moving
this warning to the daemon, which can make a better call if it will work
or not (depending on networking mode).

This warning was originally added in [moby@afa92a9], before integration with
libnetwork, and this warning may be incorrect in many scenarios.

While updating, also removing the custom regular expression used to
detect if the IP is a loopback address, and using go's netip package
instead.

[moby@afa92a9]: afa92a9af0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 16:15:50 +01:00
58a35692d6 remove duplicate --oom-kill-disable warnings on docker run / docker create
This warning was originally added in [moby@3aa70c1], and moved to be printed
on both `run` and `create` in commit 7c514a31c9.

However, [moby@57f1305] (docker 19.03, API 1.40) moved such warnings to
the daemon side. The patch mentioned this issue:

> This patch will have one side-effect; docker cli's that also perform this check
> client-side will print the warning twice; this can be addressed by disabling
> the cli-side check for newer API versions, but will generate a bit of extra
> noise when using an older CLI.

The CLI does not take this into account currently, and still prints warnings
twice; even in cases where the option is not supported by the daemon, and
discarded:

On a host without OomKillDisable support:

    docker create --oom-kill-disable alpine
    WARNING: Disabling the OOM killer on containers without setting a '-m/--memory' limit may be dangerous.
    WARNING: Your kernel does not support OomKillDisable. OomKillDisable discarded.

On a host that supports it:

    docker create --oom-kill-disable alpine
    WARNING: Disabling the OOM killer on containers without setting a '-m/--memory' limit may be dangerous.
    WARNING: OOM killer is disabled for the container, but no memory limit is set, this can result in the system running out of resources.

This patch removes the client-side warning, leaving it to the daemon to
report if any warnings should produced (and the client to print them).

With this patch applied:

On a host without OomKillDisable support:

    docker create --oom-kill-disable alpine
    WARNING: Your kernel does not support OomKillDisable. OomKillDisable discarded.

On a host that supports it:

    docker create --oom-kill-disable alpine
    WARNING: OOM killer is disabled for the container, but no memory limit is set, this can result in the system running out of resources.

[moby@3aa70c1]: 3aa70c1948
[moby@57f1305]: 57f1305e74

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 15:39:21 +01:00
f6d49e9ca4 docs: remove legacy build-tags
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 12:47:19 +01:00
46caf5697c remove legacy build-tags
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-08 12:47:03 +01:00
2eec74659e Merge pull request #5901 from NinaLua/master
chore: make function comment match function name
2025-03-07 20:42:38 +01:00
8fc0c74f9a cli-plugins/manager: use stdlib errors, and minor cleanup
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-07 19:14:32 +01:00
e201b4e8a5 Merge pull request #5902 from thaJeztah/cli_plugin_metadata
move cli-plugins metadata types/consts to a separate package
2025-03-07 19:13:02 +01:00
292713c887 move cli-plugins annotation consts to a separate package
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-07 12:46:11 +01:00
4321293972 move cli-plugins metadata types/consts to a separate package
This prevents cli-plugins having to import the plugin-manager.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-07 12:38:06 +01:00
aa66f07a3e chore: make function comment match function name
Signed-off-by: NinaLua <iturf@sina.cn>
2025-03-07 14:21:27 +08:00