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

Lines changed: 370 additions & 268 deletions

cli/cobra.go

Lines changed: 0 additions & 10 deletions
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

Lines changed: 0 additions & 6 deletions
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

Lines changed: 0 additions & 10 deletions
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

Lines changed: 0 additions & 6 deletions
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

Lines changed: 1 addition & 6 deletions
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

Lines changed: 1 addition & 4 deletions
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

Lines changed: 1 addition & 4 deletions
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

Lines changed: 0 additions & 4 deletions
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

Lines changed: 0 additions & 10 deletions
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

Lines changed: 1 addition & 5 deletions
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")

0 commit comments

Comments
 (0)