Skip to content

Commit 0442a73

Browse files
authored
Merge pull request #5929 from vvoland/vendor-docker
vendor: github.com/docker/docker v28.0.2-dev (bea4de25004d)
2 parents 888716a + bb0e9ad commit 0442a73

40 files changed

+370
-268
lines changed

cli/cobra.go

-10
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@ package cli
33
import (
44
"fmt"
55
"os"
6-
"path/filepath"
76
"sort"
87
"strings"
98

109
"github.com/docker/cli/cli-plugins/metadata"
1110
"github.com/docker/cli/cli/command"
1211
cliflags "github.com/docker/cli/cli/flags"
13-
"github.com/docker/docker/pkg/homedir"
14-
"github.com/docker/docker/registry"
1512
"github.com/fvbommel/sortorder"
1613
"github.com/moby/term"
1714
"github.com/morikuni/aec"
@@ -62,13 +59,6 @@ func setupCommonRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *c
6259
"docs.code-delimiter": `"`, // https://github.com/docker/cli-docs-tool/blob/77abede22166eaea4af7335096bdcedd043f5b19/annotation/annotation.go#L20-L22
6360
}
6461

65-
// Configure registry.CertsDir() when running in rootless-mode
66-
if os.Getenv("ROOTLESSKIT_STATE_DIR") != "" {
67-
if configHome, err := homedir.GetConfigHome(); err == nil {
68-
registry.SetCertsDir(filepath.Join(configHome, "docker/certs.d"))
69-
}
70-
}
71-
7262
return opts, helpCommand
7363
}
7464

cli/command/container/create.go

-6
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ func runCreate(ctx context.Context, dockerCli command.Cli, flags *pflag.FlagSet,
115115
StatusCode: 125,
116116
}
117117
}
118-
if err = validateAPIVersion(containerCfg, dockerCli.Client().ClientVersion()); err != nil {
119-
return cli.StatusError{
120-
Status: withHelp(err, "create").Error(),
121-
StatusCode: 125,
122-
}
123-
}
124118
id, err := createContainer(ctx, dockerCli, containerCfg, options)
125119
if err != nil {
126120
return err

cli/command/container/opts.go

-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"strings"
1414
"time"
1515

16-
"github.com/docker/cli/cli/command"
1716
"github.com/docker/cli/cli/compose/loader"
1817
"github.com/docker/cli/opts"
1918
"github.com/docker/docker/api/types/container"
@@ -1135,12 +1134,3 @@ func validateAttach(val string) (string, error) {
11351134
}
11361135
return val, errors.Errorf("valid streams are STDIN, STDOUT and STDERR")
11371136
}
1138-
1139-
func validateAPIVersion(c *containerConfig, serverAPIVersion string) error {
1140-
for _, m := range c.HostConfig.Mounts {
1141-
if err := command.ValidateMountWithAPIVersion(m, serverAPIVersion); err != nil {
1142-
return err
1143-
}
1144-
}
1145-
return nil
1146-
}

cli/command/container/run.go

-6
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ func runRun(ctx context.Context, dockerCli command.Cli, flags *pflag.FlagSet, ro
107107
StatusCode: 125,
108108
}
109109
}
110-
if err = validateAPIVersion(containerCfg, dockerCli.CurrentVersion()); err != nil {
111-
return cli.StatusError{
112-
Status: withHelp(err, "run").Error(),
113-
StatusCode: 125,
114-
}
115-
}
116110
return runContainer(ctx, dockerCli, ropts, copts, containerCfg)
117111
}
118112

cli/command/image/push.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ Image index won't be pushed, meaning that other manifests, including attestation
7474
}
7575

7676
// RunPush performs a push against the engine based on the specified options
77-
//
78-
//nolint:gocyclo
7977
func RunPush(ctx context.Context, dockerCli command.Cli, opts pushOptions) error {
8078
var platform *ocispec.Platform
8179
out := tui.NewOutput(dockerCli.Out())
@@ -107,10 +105,7 @@ To push the complete multi-platform image, remove the --platform flag.
107105
}
108106

109107
// Resolve the Repository name from fqn to RepositoryInfo
110-
repoInfo, err := registry.ParseRepositoryInfo(ref)
111-
if err != nil {
112-
return err
113-
}
108+
repoInfo, _ := registry.ParseRepositoryInfo(ref)
114109

115110
// Resolve the Auth config relevant for this server
116111
authConfig := command.ResolveAuthConfig(dockerCli.ConfigFile(), repoInfo.Index)

cli/command/plugin/install.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ func buildPullConfig(ctx context.Context, dockerCli command.Cli, opts pluginOpti
6464
return types.PluginInstallOptions{}, err
6565
}
6666

67-
repoInfo, err := registry.ParseRepositoryInfo(ref)
68-
if err != nil {
69-
return types.PluginInstallOptions{}, err
70-
}
67+
repoInfo, _ := registry.ParseRepositoryInfo(ref)
7168

7269
remote := ref.String()
7370

cli/command/plugin/push.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ func runPush(ctx context.Context, dockerCli command.Cli, opts pushOptions) error
4949

5050
named = reference.TagNameOnly(named)
5151

52-
repoInfo, err := registry.ParseRepositoryInfo(named)
53-
if err != nil {
54-
return err
55-
}
52+
repoInfo, _ := registry.ParseRepositoryInfo(named)
5653
authConfig := command.ResolveAuthConfig(dockerCli.ConfigFile(), repoInfo.Index)
5754
encodedAuth, err := registrytypes.EncodeAuthConfig(authConfig)
5855
if err != nil {

cli/command/service/create.go

-4
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ func runCreate(ctx context.Context, dockerCLI command.Cli, flags *pflag.FlagSet,
109109
return err
110110
}
111111

112-
if err = validateAPIVersion(service, dockerCLI.Client().ClientVersion()); err != nil {
113-
return err
114-
}
115-
116112
specifiedSecrets := opts.secrets.Value()
117113
if len(specifiedSecrets) > 0 {
118114
// parse and validate secrets

cli/command/service/opts.go

-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"strings"
1212
"time"
1313

14-
"github.com/docker/cli/cli/command"
1514
"github.com/docker/cli/opts"
1615
"github.com/docker/cli/opts/swarmopts"
1716
"github.com/docker/docker/api/types/container"
@@ -1048,12 +1047,3 @@ const (
10481047
flagUlimitRemove = "ulimit-rm"
10491048
flagOomScoreAdj = "oom-score-adj"
10501049
)
1051-
1052-
func validateAPIVersion(c swarm.ServiceSpec, serverAPIVersion string) error {
1053-
for _, m := range c.TaskTemplate.ContainerSpec.Mounts {
1054-
if err := command.ValidateMountWithAPIVersion(m, serverAPIVersion); err != nil {
1055-
return err
1056-
}
1057-
}
1058-
return nil
1059-
}

cli/command/service/trust.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ func resolveServiceImageDigestContentTrust(dockerCli command.Cli, service *swarm
5151
}
5252

5353
func trustedResolveDigest(cli command.Cli, ref reference.NamedTagged) (reference.Canonical, error) {
54-
repoInfo, err := registry.ParseRepositoryInfo(ref)
55-
if err != nil {
56-
return nil, err
57-
}
58-
54+
repoInfo, _ := registry.ParseRepositoryInfo(ref)
5955
authConfig := command.ResolveAuthConfig(cli.ConfigFile(), repoInfo.Index)
6056

6157
notaryRepo, err := trust.GetNotaryRepository(cli.In(), cli.Out(), command.UserAgent(), repoInfo, &authConfig, "pull")

cli/command/utils.go

-16
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import (
1616
"github.com/docker/cli/cli/config"
1717
"github.com/docker/cli/cli/streams"
1818
"github.com/docker/docker/api/types/filters"
19-
mounttypes "github.com/docker/docker/api/types/mount"
20-
"github.com/docker/docker/api/types/versions"
2119
"github.com/docker/docker/errdefs"
2220
"github.com/moby/sys/sequential"
2321
"github.com/moby/term"
@@ -217,17 +215,3 @@ func ValidateOutputPathFileMode(fileMode os.FileMode) error {
217215
}
218216
return nil
219217
}
220-
221-
// ValidateMountWithAPIVersion validates a mount with the server API version.
222-
func ValidateMountWithAPIVersion(m mounttypes.Mount, serverAPIVersion string) error {
223-
if m.BindOptions != nil {
224-
if m.BindOptions.NonRecursive && versions.LessThan(serverAPIVersion, "1.40") {
225-
return errors.Errorf("bind-recursive=disabled requires API v1.40 or later")
226-
}
227-
// ReadOnlyNonRecursive can be safely ignored when API < 1.44
228-
if m.BindOptions.ReadOnlyForceRecursive && versions.LessThan(serverAPIVersion, "1.44") {
229-
return errors.Errorf("bind-recursive=readonly requires API v1.44 or later")
230-
}
231-
}
232-
return nil
233-
}

cli/registry/client/endpoint.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ func (r repositoryEndpoint) BaseURL() string {
3030
}
3131

3232
func newDefaultRepositoryEndpoint(ref reference.Named, insecure bool) (repositoryEndpoint, error) {
33-
repoInfo, err := registry.ParseRepositoryInfo(ref)
34-
if err != nil {
35-
return repositoryEndpoint{}, err
36-
}
33+
repoInfo, _ := registry.ParseRepositoryInfo(ref)
3734
endpoint, err := getDefaultEndpointFromRepoInfo(repoInfo)
3835
if err != nil {
3936
return repositoryEndpoint{}, err

cli/registry/client/fetcher.go

+2-9
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,7 @@ func (c *client) iterateEndpoints(ctx context.Context, namedRef reference.Named,
220220
return err
221221
}
222222

223-
repoInfo, err := registry.ParseRepositoryInfo(namedRef)
224-
if err != nil {
225-
return err
226-
}
223+
repoInfo, _ := registry.ParseRepositoryInfo(namedRef)
227224

228225
confirmedTLSRegistries := make(map[string]bool)
229226
for _, endpoint := range endpoints {
@@ -273,11 +270,6 @@ func (c *client) iterateEndpoints(ctx context.Context, namedRef reference.Named,
273270

274271
// allEndpoints returns a list of endpoints ordered by priority (v2, http).
275272
func allEndpoints(namedRef reference.Named, insecure bool) ([]registry.APIEndpoint, error) {
276-
repoInfo, err := registry.ParseRepositoryInfo(namedRef)
277-
if err != nil {
278-
return nil, err
279-
}
280-
281273
var serviceOpts registry.ServiceOptions
282274
if insecure {
283275
logrus.Debugf("allowing insecure registry for: %s", reference.Domain(namedRef))
@@ -287,6 +279,7 @@ func allEndpoints(namedRef reference.Named, insecure bool) ([]registry.APIEndpoi
287279
if err != nil {
288280
return []registry.APIEndpoint{}, err
289281
}
282+
repoInfo, _ := registry.ParseRepositoryInfo(namedRef)
290283
endpoints, err := registryService.LookupPullEndpoints(reference.Domain(repoInfo.Name))
291284
logrus.Debugf("endpoints for %s: %v", namedRef, endpoints)
292285
return endpoints, err

cli/trust/trust.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,7 @@ func GetImageReferencesAndAuth(ctx context.Context,
322322
}
323323

324324
// Resolve the Repository name from fqn to RepositoryInfo
325-
repoInfo, err := registry.ParseRepositoryInfo(ref)
326-
if err != nil {
327-
return ImageRefAndAuth{}, err
328-
}
329-
325+
repoInfo, _ := registry.ParseRepositoryInfo(ref)
330326
authConfig := authResolver(ctx, repoInfo.Index)
331327
return ImageRefAndAuth{
332328
original: imgName,

vendor.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/distribution/reference v0.6.0
1414
github.com/docker/cli-docs-tool v0.9.0
1515
github.com/docker/distribution v2.8.3+incompatible
16-
github.com/docker/docker v28.0.1+incompatible
16+
github.com/docker/docker v28.0.2-0.20250318184402-bea4de25004d+incompatible
1717
github.com/docker/docker-credential-helpers v0.9.2
1818
github.com/docker/go-connections v0.5.0
1919
github.com/docker/go-units v0.5.0

vendor.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ github.com/docker/cli-docs-tool v0.9.0/go.mod h1:ClrwlNW+UioiRyH9GiAOe1o3J/TsY3T
5151
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
5252
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
5353
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
54-
github.com/docker/docker v28.0.1+incompatible h1:FCHjSRdXhNRFjlHMTv4jUNlIBbTeRjrWfeFuJp7jpo0=
55-
github.com/docker/docker v28.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
54+
github.com/docker/docker v28.0.2-0.20250318184402-bea4de25004d+incompatible h1:Q3v/wZ4WKSQtqg3Kgiz01rNB6f2/7nBu35xnCdk9f3Q=
55+
github.com/docker/docker v28.0.2-0.20250318184402-bea4de25004d+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
5656
github.com/docker/docker-credential-helpers v0.9.2 h1:50JF7ADQiHdAVBRtg/vy883Y4U5+5GmPOBNtUU+X+6A=
5757
github.com/docker/docker-credential-helpers v0.9.2/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo=
5858
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

vendor/github.com/docker/docker/api/swagger.yaml

+8-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/api/types/registry/registry.go

+9-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/api/types/swarm/config.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/api/types/swarm/secret.go

+16-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/docker/client/container_create.go

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)