1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00
Commit Graph

11465 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
513ceeec0a cli-plugins/manager: remove deprecated ResourceAttributesEnvvar
This const was deprecated in 9dc175d6ef,
which is part of v28.0, so let's remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 12:26:22 +02:00
Sebastiaan van Stijn
5876b2941c cli-plugins/manager: deprecate metadata aliases
These aliases were added in 4321293972
(part of v28.0), but did not deprecate them. They are no longer used
in the CLI itself, but may be used by cli-plugin implementations.

This deprecates the aliases in `cli-plugins/manager` in favor of
their equivalent in `cli-plugins/manager/metadata`:

- `NamePrefix`
- `MetadataSubcommandName`
- `HookSubcommandName`
- `Metadata`
- `ReexecEnvvar`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 12:26:22 +02:00
Sebastiaan van Stijn
50963accec cli-plugins/manager: wrapAsPluginError: don't special-case nil
This was a pattern inheritted from pkg/errors.Wrapf, which ignored
nil errors for convenience. However, it is error-prone, as it is
not obvious when returning a nil-error.

All call-sites using `wrapAsPluginError` already do a check for
nil errors, so remove this code to prevent hard to find bugs.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 12:26:14 +02:00
Sebastiaan van Stijn
d789bac04a cli-plugins/manager: pluginError: remove Causer interface
We no longer depend on this interface and it implements Unwrap for
native handling by go stdlib.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 11:11:52 +02:00
Sebastiaan van Stijn
71460215d3 cli-plugins/manager: deprecate "IsNotFound"
These errors satisfy errdefs.IsNotFound, so make it a wrapper, and
deprecate it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 11:06:49 +02:00
Sebastiaan van Stijn
1cc698c68f cli-plugins/manager: un-export "NewPluginError"
It is for internal use, and no longer needed for testing, now that
the `Plugin` type handles marshalling errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 11:01:24 +02:00
Sebastiaan van Stijn
549d39a89f cli-plugins/manager: fix Plugin marshaling with regular errors
Go does not by default marshal `error` type fields to JSON. The manager
package therefore implemented a `pluginError` type that implements
[encoding.TextMarshaler]. However, the field was marked as a regular
`error`, which made it brittle; assining any other type of error would
result in the error being discarded in the marshaled JSON (as used in
`docker info` output), resulting in the error being marshaled as `{}`.

This patch adds a custom `MarshalJSON()` on the `Plugin` type itself
so that any error is rendered. It checks if the error used already
implements [encoding.TextMarshaler], otherwise wraps the error in
a `pluginError`.

[encoding.TextMarshaler]: https://pkg.go.dev/encoding#TextMarshaler

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 10:55:16 +02:00
Sebastiaan van Stijn
54367b3283 cli-plugins/manager: un-export "Candidate" interface
It is for internal use for mocking purposes, and is not part
of any public interface / signature.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-04 09:14:13 +02:00
Sebastiaan van Stijn
f86ad2ea4c Merge pull request #6228 from thaJeztah/bump_version
bump version to v29.0.0-dev
2025-07-31 18:28:28 +02:00
Sebastiaan van Stijn
a4bf9e78e5 Merge pull request #6227 from thaJeztah/cleanup_swarmopts
opts/swarmopts: minor cleanup and refactor
2025-07-31 18:28:07 +02:00
Sebastiaan van Stijn
a1ea79444b Merge pull request #6230 from robmry/moby29_dockerd_reference
dockerd.md: --firewall-backend and --bridge-accept-fwmark
2025-07-31 18:27:03 +02:00
Sebastiaan van Stijn
066710ba7b opts/swarmopts: minor cleanup and refactor
- Use strong-typed switches for validating options
- Initialize defaults instead of setting them after
  parsing the ports. Each option should be validated
  as part of the parsing, so no invalid (or empty)
  values should be set.
- Put variables closer to where they're used, and
  pre-allocate slices.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-31 18:19:58 +02:00
Sebastiaan van Stijn
b8df4abeb5 bump version to v29.0.0-dev
This file is only used as default if no version is specified. We
should probably get rid of this, but let's update it to better
reflect the version that developer builds are building.

d48fb9f9f7/docker.Makefile (L22)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-31 18:17:29 +02:00
Rob Murray
3f0ccd1b71 dockerd.md: Add --firewall-backend
Related to 39ab393274

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-31 17:11:47 +01:00
Rob Murray
6176a7686e dockerd.md: add --bridge-accept-fwmark
Related to cf1695bef1

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-07-31 17:11:47 +01:00
Sebastiaan van Stijn
66aca29f7d Merge pull request #6226 from thaJeztah/bump_engine
vendor: docker/docker, moby/moby/api and moby/moby/client 4faedf2bec36
2025-07-31 18:10:08 +02:00
Sebastiaan van Stijn
f937e62c89 replace direct uses of github.com/docker/go-connections/nat types
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-31 17:37:34 +02:00
Sebastiaan van Stijn
bf16dd1251 vendor: docker/docker, moby/moby/api and moby/moby/client 4faedf2bec36
notable changes:

- api: remove deprecated NoBaseImageSpecifier
- api/stdcopy: move to api/pkg/stdcopy
- api/types/container: add aliases for go-connections/nat types
- pkg/progress: move to api/pkg/progress
- pkg/jsonmessage: move JSONError to api/types/jsonstream
- pkg/jsonmessage: move JSONProgress to api/types/jsonstream
- pkg/jsonmessage: move to client/pkg/jsonmessage
- pkg/jsonmessage: remove github.com/morikuni/aec dependency
- pkg/jsonmessage: stop printing deprecated progressDetail, errorDetail,
  remove DisplayJSONMessagesToStream and Stream interface
- pkg/streamformatter: move to api/pkg/streamformatter
- pkg/streamformatter: split from pkg/jsonmessage

full diff: 2574c2b2e9...4faedf2bec

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-31 17:31:01 +02:00
Sebastiaan van Stijn
2199a05e08 Merge pull request #6212 from carsontham/e2e-test-container-rename
intergration-cli: migrate TestContainerAPIRename to cli e2e test
2025-07-29 20:17:38 +02:00
carsontham
149503a32c migrate e2e container rename test
Signed-off-by: carsontham <carsontham@outlook.com>
2025-07-29 20:07:15 +02:00
Sebastiaan van Stijn
14203bbc77 Merge pull request #6216 from thaJeztah/bump_engine
vendor: docker/docker, moby/moby/api and moby/moby/client 2574c2b2e917
2025-07-29 19:51:52 +02:00
Sebastiaan van Stijn
b6d7ac34be vendor: docker/docker, moby/moby/api and moby/moby/client 2574c2b2e917
notable changes;

- api/types/container: move StateStatus, NewStateStatus internal again
- daemon/server/httputils: remove ContainerDecoder interface
- runconfig: move to daemon/internal/runconfig
- pkg/stack: move to daemon/internal
- remove pkg/stringid as it has moved to the client module
- remove pkg/stdcopy as it has moved to the api module
- pkg/rootless: move to daemon/internal
- move api/types/plugins/logdriver to daemon/internal
- move api/types/plugins/logdriver to daemon/internal
- pkg/system: move to daemon/internal
- remove pkg/fileutils

full diff: 25e2b4d485...2574c2b2e9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-29 18:56:56 +02:00
Sebastiaan van Stijn
83e507377a vendor: docker/docker, moby/moby/api and moby/moby/client 25e2b4d48551
notable changes:

- api/types/container.StatsResponseReader: move to client
- api/types: move backend types to daemon/server
- runconfig: remove exported errors

full diff: c4afa77157...25e2b4d485

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-29 18:48:18 +02:00
Sebastiaan van Stijn
a0ae6e6a5a Merge pull request #6215 from thaJeztah/ParseRepositoryInfo_no_err
internal/registry: ParseRepositoryInfo: remove unused error return
2025-07-29 18:41:18 +02:00
Sebastiaan van Stijn
86b5b528a6 internal/registry: ParseRepositoryInfo: remove unused error return
Removed the error return from the `ParseRepositoryInfo` function.
There are no validation steps inside `ParseRepositoryInfo` which
could cause an error, so we always returned a nil error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-29 18:32:15 +02:00
Sebastiaan van Stijn
f0030712e9 Merge pull request #6217 from thaJeztah/errdefs_unalias
remove aliases for containerd/errdefs, disallow docker/errdefs
2025-07-28 20:12:39 +02:00
Sebastiaan van Stijn
89d8c8a2a7 remove aliases for containerd/errdefs, disallow docker/errdefs
We transitioned most functionality of docker/errdefs to containerd
errdefs module, and the docker/errdefs package should no longer be
used.

Because of that, there will no longer be ambiguity, so we can remove
the aliases for this package, and use it as "errdefs".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 14:55:43 +02:00
Sebastiaan van Stijn
e2a4e429bc Merge pull request #6211 from thaJeztah/bump_engine
vendor: update docker, api, client to master, consume client/pkg/stringid
2025-07-28 14:25:36 +02:00
Sebastiaan van Stijn
fdc4397906 Merge pull request #6214 from thaJeztah/template_deprecate_newparse
templates: deprecate NewParse()
2025-07-28 11:26:37 +02:00
Sebastiaan van Stijn
d63cae6f1c cli/command/formatter: use alias/wrapper for TruncateID
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 08:50:15 +02:00
Sebastiaan van Stijn
4bd6b6897f vendor: update docker, api, client to master
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 08:50:13 +02:00
Sebastiaan van Stijn
a1035b0796 Merge pull request #6213 from thaJeztah/cleanup_plugins
cli/command/plugin: fix linting issues, and assorted cleanups
2025-07-28 08:49:00 +02:00
Sebastiaan van Stijn
7ab3e7e774 templates: deprecate NewParse()
It it just a chain of `New("sometag").Parse(...)`, and most of our
uses don't use a tag for the template, so can call Parse.

There's no public users of this function, but deprecating it first
just in case.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-28 08:25:02 +02:00
Sebastiaan van Stijn
c6f935eba5 cli/command/plugin: fix linting issues, and assorted cleanups
- fix various unhandled errors
- remove some locally defined option-types in favor of option-types
  defined by the client / api
- don't use unkeyed structs in tests, and add docs for some subtests
- fix some values in tests that triggered "spellcheck" warnings
- inline vars / functions that only had a single use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-26 16:45:04 +02:00
Sebastiaan van Stijn
2f87a11e96 Merge pull request #6202 from Mewsen/issue/6188
refactor(cli/compose/loader): extract ParseVolume() to its own package
2025-07-25 17:08:54 +02:00
Michael Tews
ef7fd8bb67 refactor(cli/compose/loader): extract ParseVolume() to its own package
Moves ParseVolume() to a new internal package to remove the dependency
on cli/compose/loader in cli/command/container/opts.go

refactor to keep types isolated

- rename the package to "volumespec" to reuse the name of the package
  as part of the name (parsevolume.ParseVolume() -> volumespec.Parse())
- move the related compose types to the internal package as well,
  and rename them to be more generic (not associated with "compose");
  - ServiceVolumeConfig -> VolumeConfig
  - ServiceVolumeBind -> BindOpts
  - ServiceVolumeVolume -> VolumeOpts
  - ServiceVolumeImage -> ImageOpts
  - ServiceVolumeTmpfs -> TmpFsOpts
  - ServiceVolumeCluster -> ClusterOpts
- alias the internal types inside cli/compose/types to keep backward
  compatibility (for any external consumers); even though the implementation
  is internal, Go allows aliasing types to use them externally.

Signed-off-by: Michael Tews <michael@tews.dev>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 16:56:17 +02:00
Paweł Gronowski
3046019d3b Merge pull request #6209 from vvoland/image-tree-nonexp
image/tree: Unmark as experimental, warn when redirected
2025-07-25 12:58:37 +02:00
Sebastiaan van Stijn
1eeb0cc3e1 Merge pull request #6207 from thaJeztah/fork_registry
add internal fork of docker/docker/registry
2025-07-25 12:57:47 +02:00
Paweł Gronowski
9257cc7f68 image/tree: Unmark as experimental, warn when redirected
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-25 12:07:54 +02:00
Paweł Gronowski
f214f860b6 image/tree: Remove extra newline after legend
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-25 12:04:42 +02:00
Sebastiaan van Stijn
f907c7a4b0 internal/registry: fix linting issues (revive)
internal/registry/errors.go:26:43: use-any: since Go 1.18 'interface{}' can be replaced by 'any' (revive)
    func invalidParamf(format string, args ...interface{}) error {
                                              ^
    internal/registry/registry_mock_test.go:52:51: use-any: since Go 1.18 'interface{}' can be replaced by 'any' (revive)
    func writeResponse(w http.ResponseWriter, message interface{}, code int) {
                                                      ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-25 00:08:26 +02:00
Sebastiaan van Stijn
cd277a5815 cli/command/system: remove use of Mirrors field in test
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:29:48 +02:00
Sebastiaan van Stijn
c297770d2d internal/registry: remove pkg/errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:29:47 +02:00
Sebastiaan van Stijn
219cfc8b7d internal/registry: define local serviceConfig
The registry.ServiceConfig struct in the API types was meant for the
registry configuration on the daemon side; it has variuos fields we
don't use, defines methods for (un)marshaling JSON, and a custom version
of `net.IPNet`, also to (un)marshal JSON.

None of that is needed, so let's change it to a local type, and implement
a constructor (as we now only have "insecure registries" to care
about).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:29:47 +02:00
Sebastiaan van Stijn
2607ba8062 internal/registry: remove ValidateIndexName
It was written to be used as validate-func for command-line flags, which
we don't use it for (which for CLI-flags includes normalizing the value).

The validation itself didn't add much; it only checked the registry didn't
start or end with a hyphen (which would still fail when parsing).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:29:36 +02:00
Sebastiaan van Stijn
5322affc9f internal/registry: remove duplicate endpoint methods
now that we no longer need to account for mirrors, these were
identical, so just use a single one.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:23:11 +02:00
Sebastiaan van Stijn
dc41365b56 internal/registry: remove NewStaticCredentialStore
It was only used in a single place; inline it there.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:23:10 +02:00
Sebastiaan van Stijn
dad2e67860 internal/registry: remove PingResponseError
It's not matched anywhere, so we can just return a plain error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:23:10 +02:00
Sebastiaan van Stijn
7cf245d2f7 internal/registry: Service.Auth remove unused statusmessage return
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:23:10 +02:00
Sebastiaan van Stijn
e0b351b3d9 internal/registry: remove code related to mirrors
The CLI does not have information about mirrors, and doesn't
configure them, so we can remove these parts.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-24 23:23:02 +02:00