Skip to content

[28.x] vendor: github.com/docker/docker a8682c5d39e7 (v28.4.0-dev) #6266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 25 commits into
base: 28.x
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Aug 14, 2025

full diff: moby/moby@v28.3.3...a8682c5

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2025

@thaJeztah thaJeztah changed the title [28.x] vendor: github.com/docker/docker fc31d47bee9e (v28.4.0-dev) [28.x] vendor: github.com/docker/docker a8682c5d39e7 (v28.4.0-dev) Aug 15, 2025
This utility was only used in the CLI, but the implementation was
based on it being used on the daemon side, so included resolving
the host's IP-address, mirrors, etc.

The only reason it's used in the CLI is to provide credentials for
the registry that's being searched, so reduce it to just that.

There's more cleaning up to do in this area, so to make our lives
easier, it's implemented locally as non-exported functions; likely
to be replaced with something else.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit e504faf)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
This adds an internal fork of [github.com/docker/docker/registry], taken
at commit [moby@f651a5d]. Git history  was not preserved in this fork,
but can be found using the URLs provided.

This fork was created to remove the dependency on the "Moby" codebase,
and because the CLI only needs a subset of its features. The original
package was written specifically for use in the daemon code, and includes
functionality that cannot be used in the CLI.

[github.com/docker/docker/registry]: https://pkg.go.dev/github.com/docker/[email protected]+incompatible/registry
[moby@49306c6]: https://github.com/moby/moby/tree/49306c607b72c5bf0a8e426f5a9760fa5ef96ea0/registry

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit f6b90bc)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 7716219)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit e0b351b)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 7cf245d)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
It's not matched anywhere, so we can just return a plain error.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit dad2e67)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
It was only used in a single place; inline it there.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit dc41365)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 5322aff)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 2607ba8)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 219cfc8)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit c297770)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit cd277a5)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
    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 <[email protected]>
(cherry picked from commit f907c7a)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 86b5b52)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Most places only use IndexInfo (and may not even need that), so replace
the use of ParseRepositoryInfo for NewIndexInfo, and move the RepositoryInfo
type to the trust package, which uses it as part of its ImageRefAndAuth
struct.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 21e8bbc)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 89d8c8a)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
It is for internal use for mocking purposes, and is not part
of any public interface / signature.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 54367b3)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 549d39a)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 1cc698c)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
These errors satisfy errdefs.IsNotFound, so make it a wrapper, and
deprecate it.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 7146021)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
We no longer depend on this interface and it implements Unwrap for
native handling by go stdlib.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit d789bac)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
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 <[email protected]>
(cherry picked from commit 50963ac)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
These aliases were added in 4321293
(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 <[email protected]>
(cherry picked from commit 5876b29)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
This const was deprecated in 9dc175d,
which is part of v28.0, so let's remove it.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 513ceee)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants