-
Notifications
You must be signed in to change notification settings - Fork 2k
[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
thaJeztah
wants to merge
25
commits into
docker:28.x
Choose a base branch
from
thaJeztah:28.x_bump_engine
base: 28.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,373
−2,118
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
3a90421
to
8f3bca1
Compare
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]>
8f3bca1
to
04b74ea
Compare
full diff: moby/moby@v28.3.3...a8682c5 Signed-off-by: Sebastiaan van Stijn <[email protected]>
04b74ea
to
6465faf
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)