From 4665398a060908da67425c0b7557170da5dec1f1 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 May 2025 13:55:23 +0200 Subject: [PATCH] vendor: github.com/docker/docker 7937f0846c13 (master, v28.x dev) full diff: https://github.com/docker/docker/compare/4b9f0707a039...7937f0846c130e91836f5f640c41ce12d07da4c8 Signed-off-by: Sebastiaan van Stijn --- cli/command/cli.go | 6 +- cli/command/config/client_test.go | 11 +-- cli/command/config/cmd.go | 4 +- cli/command/config/create_test.go | 27 +++--- cli/command/config/ls.go | 4 +- cli/command/config/ls_test.go | 15 ++- cli/command/image/build.go | 10 +- cli/command/image/build_test.go | 10 +- cli/command/image/client_test.go | 8 +- cli/command/secret/client_test.go | 11 +-- cli/command/secret/cmd.go | 4 +- cli/command/secret/create_test.go | 37 ++++---- cli/command/secret/ls.go | 4 +- cli/command/secret/ls_test.go | 15 ++- cli/command/service/create_test.go | 17 ++-- cli/command/service/parse.go | 5 +- cli/command/service/update_test.go | 9 +- cli/command/stack/client_test.go | 8 +- cli/command/stack/swarm/client_test.go | 8 +- cli/command/stack/swarm/common.go | 4 +- cli/compose/convert/service_test.go | 13 ++- cmd/docker/builder.go | 4 +- vendor.mod | 2 +- vendor.sum | 4 +- .../docker/docker/api/types/build/build.go | 91 +++++++++++++++++++ .../docker/docker/api/types/client.go | 81 ----------------- .../docker/docker/api/types/swarm/config.go | 18 +++- .../docker/docker/api/types/swarm/secret.go | 18 +++- .../docker/docker/api/types/types.go | 32 +------ .../docker/api/types/types_deprecated.go | 62 +++++++++++++ .../docker/docker/client/client_interfaces.go | 10 +- .../docker/docker/client/config_create.go | 5 +- .../docker/docker/client/config_list.go | 3 +- .../docker/docker/client/image_build.go | 14 +-- .../github.com/docker/docker/client/ping.go | 3 +- .../docker/docker/client/secret_create.go | 9 +- .../docker/docker/client/secret_list.go | 3 +- vendor/modules.txt | 2 +- 38 files changed, 326 insertions(+), 265 deletions(-) create mode 100644 vendor/github.com/docker/docker/api/types/build/build.go diff --git a/cli/command/cli.go b/cli/command/cli.go index b78525bc82..1e042ec0e2 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -24,7 +24,7 @@ import ( "github.com/docker/cli/cli/version" dopts "github.com/docker/cli/opts" "github.com/docker/docker/api" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/pkg/errors" @@ -180,7 +180,7 @@ func (cli *DockerCli) BuildKitEnabled() (bool, error) { } si := cli.ServerInfo() - if si.BuildkitVersion == types.BuilderBuildKit { + if si.BuildkitVersion == build.BuilderBuildKit { // The daemon advertised BuildKit as the preferred builder; this may // be either a Linux daemon or a Windows daemon with experimental // BuildKit support enabled. @@ -510,7 +510,7 @@ func (cli *DockerCli) Apply(ops ...CLIOption) error { type ServerInfo struct { HasExperimental bool OSType string - BuildkitVersion types.BuilderVersion + BuildkitVersion build.BuilderVersion // SwarmStatus provides information about the current swarm status of the // engine, obtained from the "Swarm" header in the API response. diff --git a/cli/command/config/client_test.go b/cli/command/config/client_test.go index c3c938a7be..14c68d504d 100644 --- a/cli/command/config/client_test.go +++ b/cli/command/config/client_test.go @@ -3,24 +3,23 @@ package config import ( "context" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" ) type fakeClient struct { client.Client - configCreateFunc func(context.Context, swarm.ConfigSpec) (types.ConfigCreateResponse, error) + configCreateFunc func(context.Context, swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) configInspectFunc func(context.Context, string) (swarm.Config, []byte, error) - configListFunc func(context.Context, types.ConfigListOptions) ([]swarm.Config, error) + configListFunc func(context.Context, swarm.ConfigListOptions) ([]swarm.Config, error) configRemoveFunc func(string) error } -func (c *fakeClient) ConfigCreate(ctx context.Context, spec swarm.ConfigSpec) (types.ConfigCreateResponse, error) { +func (c *fakeClient) ConfigCreate(ctx context.Context, spec swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { if c.configCreateFunc != nil { return c.configCreateFunc(ctx, spec) } - return types.ConfigCreateResponse{}, nil + return swarm.ConfigCreateResponse{}, nil } func (c *fakeClient) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) { @@ -30,7 +29,7 @@ func (c *fakeClient) ConfigInspectWithRaw(ctx context.Context, id string) (swarm return swarm.Config{}, nil, nil } -func (c *fakeClient) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { +func (c *fakeClient) ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { if c.configListFunc != nil { return c.configListFunc(ctx, options) } diff --git a/cli/command/config/cmd.go b/cli/command/config/cmd.go index 6c1969dff7..d83e33b205 100644 --- a/cli/command/config/cmd.go +++ b/cli/command/config/cmd.go @@ -4,7 +4,7 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command/completion" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" "github.com/spf13/cobra" ) @@ -32,7 +32,7 @@ func NewConfigCommand(dockerCli command.Cli) *cobra.Command { // completeNames offers completion for swarm configs func completeNames(dockerCLI completion.APIClientProvider) cobra.CompletionFunc { return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - list, err := dockerCLI.Client().ConfigList(cmd.Context(), types.ConfigListOptions{}) + list, err := dockerCLI.Client().ConfigList(cmd.Context(), swarm.ConfigListOptions{}) if err != nil { return nil, cobra.ShellCompDirectiveError } diff --git a/cli/command/config/create_test.go b/cli/command/config/create_test.go index 0b2976f027..f5d6727bfc 100644 --- a/cli/command/config/create_test.go +++ b/cli/command/config/create_test.go @@ -12,7 +12,6 @@ import ( "testing" "github.com/docker/cli/internal/test" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" @@ -24,7 +23,7 @@ const configDataFile = "config-create-with-name.golden" func TestConfigCreateErrors(t *testing.T) { testCases := []struct { args []string - configCreateFunc func(context.Context, swarm.ConfigSpec) (types.ConfigCreateResponse, error) + configCreateFunc func(context.Context, swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) expectedError string }{ { @@ -37,8 +36,8 @@ func TestConfigCreateErrors(t *testing.T) { }, { args: []string{"name", filepath.Join("testdata", configDataFile)}, - configCreateFunc: func(_ context.Context, configSpec swarm.ConfigSpec) (types.ConfigCreateResponse, error) { - return types.ConfigCreateResponse{}, errors.New("error creating config") + configCreateFunc: func(_ context.Context, configSpec swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { + return swarm.ConfigCreateResponse{}, errors.New("error creating config") }, expectedError: "error creating config", }, @@ -62,14 +61,14 @@ func TestConfigCreateWithName(t *testing.T) { const name = "config-with-name" var actual []byte cli := test.NewFakeCli(&fakeClient{ - configCreateFunc: func(_ context.Context, spec swarm.ConfigSpec) (types.ConfigCreateResponse, error) { + configCreateFunc: func(_ context.Context, spec swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { if spec.Name != name { - return types.ConfigCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) + return swarm.ConfigCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) } actual = spec.Data - return types.ConfigCreateResponse{ + return swarm.ConfigCreateResponse{ ID: "ID-" + spec.Name, }, nil }, @@ -101,12 +100,12 @@ func TestConfigCreateWithLabels(t *testing.T) { } cli := test.NewFakeCli(&fakeClient{ - configCreateFunc: func(_ context.Context, spec swarm.ConfigSpec) (types.ConfigCreateResponse, error) { + configCreateFunc: func(_ context.Context, spec swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { if !reflect.DeepEqual(spec, expected) { - return types.ConfigCreateResponse{}, fmt.Errorf("expected %+v, got %+v", expected, spec) + return swarm.ConfigCreateResponse{}, fmt.Errorf("expected %+v, got %+v", expected, spec) } - return types.ConfigCreateResponse{ + return swarm.ConfigCreateResponse{ ID: "ID-" + spec.Name, }, nil }, @@ -127,16 +126,16 @@ func TestConfigCreateWithTemplatingDriver(t *testing.T) { const name = "config-with-template-driver" cli := test.NewFakeCli(&fakeClient{ - configCreateFunc: func(_ context.Context, spec swarm.ConfigSpec) (types.ConfigCreateResponse, error) { + configCreateFunc: func(_ context.Context, spec swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { if spec.Name != name { - return types.ConfigCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) + return swarm.ConfigCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) } if spec.Templating.Name != expectedDriver.Name { - return types.ConfigCreateResponse{}, fmt.Errorf("expected driver %v, got %v", expectedDriver, spec.Labels) + return swarm.ConfigCreateResponse{}, fmt.Errorf("expected driver %v, got %v", expectedDriver, spec.Labels) } - return types.ConfigCreateResponse{ + return swarm.ConfigCreateResponse{ ID: "ID-" + spec.Name, }, nil }, diff --git a/cli/command/config/ls.go b/cli/command/config/ls.go index 8ffaab4455..f6e68cfaa2 100644 --- a/cli/command/config/ls.go +++ b/cli/command/config/ls.go @@ -10,7 +10,7 @@ import ( "github.com/docker/cli/cli/command/formatter" flagsHelper "github.com/docker/cli/cli/flags" "github.com/docker/cli/opts" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" "github.com/fvbommel/sortorder" "github.com/spf13/cobra" ) @@ -48,7 +48,7 @@ func newConfigListCommand(dockerCli command.Cli) *cobra.Command { func RunConfigList(ctx context.Context, dockerCLI command.Cli, options ListOptions) error { apiClient := dockerCLI.Client() - configs, err := apiClient.ConfigList(ctx, types.ConfigListOptions{Filters: options.Filter.Value()}) + configs, err := apiClient.ConfigList(ctx, swarm.ConfigListOptions{Filters: options.Filter.Value()}) if err != nil { return err } diff --git a/cli/command/config/ls_test.go b/cli/command/config/ls_test.go index d740ef9278..6bc712aaf0 100644 --- a/cli/command/config/ls_test.go +++ b/cli/command/config/ls_test.go @@ -10,7 +10,6 @@ import ( "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/internal/test" "github.com/docker/cli/internal/test/builders" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" @@ -20,7 +19,7 @@ import ( func TestConfigListErrors(t *testing.T) { testCases := []struct { args []string - configListFunc func(context.Context, types.ConfigListOptions) ([]swarm.Config, error) + configListFunc func(context.Context, swarm.ConfigListOptions) ([]swarm.Config, error) expectedError string }{ { @@ -28,7 +27,7 @@ func TestConfigListErrors(t *testing.T) { expectedError: "accepts no argument", }, { - configListFunc: func(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { + configListFunc: func(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { return []swarm.Config{}, errors.New("error listing configs") }, expectedError: "error listing configs", @@ -49,7 +48,7 @@ func TestConfigListErrors(t *testing.T) { func TestConfigList(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - configListFunc: func(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { + configListFunc: func(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { return []swarm.Config{ *builders.Config(builders.ConfigID("ID-1-foo"), builders.ConfigName("1-foo"), @@ -79,7 +78,7 @@ func TestConfigList(t *testing.T) { func TestConfigListWithQuietOption(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - configListFunc: func(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { + configListFunc: func(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { return []swarm.Config{ *builders.Config(builders.ConfigID("ID-foo"), builders.ConfigName("foo")), *builders.Config(builders.ConfigID("ID-bar"), builders.ConfigName("bar"), builders.ConfigLabels(map[string]string{ @@ -96,7 +95,7 @@ func TestConfigListWithQuietOption(t *testing.T) { func TestConfigListWithConfigFormat(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - configListFunc: func(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { + configListFunc: func(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { return []swarm.Config{ *builders.Config(builders.ConfigID("ID-foo"), builders.ConfigName("foo")), *builders.Config(builders.ConfigID("ID-bar"), builders.ConfigName("bar"), builders.ConfigLabels(map[string]string{ @@ -115,7 +114,7 @@ func TestConfigListWithConfigFormat(t *testing.T) { func TestConfigListWithFormat(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - configListFunc: func(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { + configListFunc: func(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { return []swarm.Config{ *builders.Config(builders.ConfigID("ID-foo"), builders.ConfigName("foo")), *builders.Config(builders.ConfigID("ID-bar"), builders.ConfigName("bar"), builders.ConfigLabels(map[string]string{ @@ -132,7 +131,7 @@ func TestConfigListWithFormat(t *testing.T) { func TestConfigListWithFilter(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - configListFunc: func(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { + configListFunc: func(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { assert.Check(t, is.Equal("foo", options.Filters.Get("name")[0])) assert.Check(t, is.Equal("lbl1=Label-bar", options.Filters.Get("label")[0])) return []swarm.Config{ diff --git a/cli/command/image/build.go b/cli/command/image/build.go index 4f081c4cce..66beeee2bb 100644 --- a/cli/command/image/build.go +++ b/cli/command/image/build.go @@ -25,7 +25,7 @@ import ( "github.com/docker/cli/internal/lazyregexp" "github.com/docker/cli/opts" "github.com/docker/docker/api" - "github.com/docker/docker/api/types" + buildtypes "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/builder/remotecontext/urlutil" @@ -337,7 +337,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) authConfigs[k] = registrytypes.AuthConfig(auth) } buildOpts := imageBuildOptions(dockerCli, options) - buildOpts.Version = types.BuilderV1 + buildOpts.Version = buildtypes.BuilderV1 buildOpts.Dockerfile = relDockerfile buildOpts.AuthConfigs = authConfigs buildOpts.RemoteContext = remote @@ -354,7 +354,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) imageID := "" aux := func(msg jsonstream.JSONMessage) { - var result types.BuildResult + var result buildtypes.Result if err := json.Unmarshal(*msg.Aux, &result); err != nil { _, _ = fmt.Fprintf(dockerCli.Err(), "Failed to parse aux message: %s", err) } else { @@ -540,9 +540,9 @@ func replaceDockerfileForContentTrust(ctx context.Context, inputTarStream io.Rea return pipeReader } -func imageBuildOptions(dockerCli command.Cli, options buildOptions) types.ImageBuildOptions { +func imageBuildOptions(dockerCli command.Cli, options buildOptions) buildtypes.ImageBuildOptions { configFile := dockerCli.ConfigFile() - return types.ImageBuildOptions{ + return buildtypes.ImageBuildOptions{ Memory: options.memory.Value(), MemorySwap: options.memorySwap.Value(), Tags: options.tags.GetSlice(), diff --git a/cli/command/image/build_test.go b/cli/command/image/build_test.go index b095fba884..22105e47c0 100644 --- a/cli/command/image/build_test.go +++ b/cli/command/image/build_test.go @@ -13,7 +13,7 @@ import ( "github.com/docker/cli/cli/streams" "github.com/docker/cli/internal/test" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/google/go-cmp/cmp" "github.com/moby/go-archive/compression" "gotest.tools/v3/assert" @@ -25,7 +25,7 @@ func TestRunBuildDockerfileFromStdinWithCompress(t *testing.T) { t.Setenv("DOCKER_BUILDKIT", "0") buffer := new(bytes.Buffer) fakeBuild := newFakeBuild() - fakeImageBuild := func(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { + fakeImageBuild := func(ctx context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) { tee := io.TeeReader(buildContext, buffer) gzipReader, err := gzip.NewReader(tee) assert.NilError(t, err) @@ -178,18 +178,18 @@ RUN echo hello world type fakeBuild struct { context *tar.Reader - options types.ImageBuildOptions + options build.ImageBuildOptions } func newFakeBuild() *fakeBuild { return &fakeBuild{} } -func (f *fakeBuild) build(_ context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { +func (f *fakeBuild) build(_ context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) { f.context = tar.NewReader(buildContext) f.options = options body := new(bytes.Buffer) - return types.ImageBuildResponse{Body: io.NopCloser(body)}, nil + return build.ImageBuildResponse{Body: io.NopCloser(body)}, nil } func (f *fakeBuild) headers(t *testing.T) []*tar.Header { diff --git a/cli/command/image/client_test.go b/cli/command/image/client_test.go index 9144b9951b..dd81f63725 100644 --- a/cli/command/image/client_test.go +++ b/cli/command/image/client_test.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/system" @@ -27,7 +27,7 @@ type fakeClient struct { imageInspectFunc func(img string) (image.InspectResponse, error) imageImportFunc func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) imageHistoryFunc func(img string, options ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error) - imageBuildFunc func(context.Context, io.Reader, types.ImageBuildOptions) (types.ImageBuildResponse, error) + imageBuildFunc func(context.Context, io.Reader, build.ImageBuildOptions) (build.ImageBuildResponse, error) } func (cli *fakeClient) ImageTag(_ context.Context, img, ref string) error { @@ -118,9 +118,9 @@ func (cli *fakeClient) ImageHistory(_ context.Context, img string, options ...cl return []image.HistoryResponseItem{{ID: img, Created: time.Now().Unix()}}, nil } -func (cli *fakeClient) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { +func (cli *fakeClient) ImageBuild(ctx context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) { if cli.imageBuildFunc != nil { return cli.imageBuildFunc(ctx, buildContext, options) } - return types.ImageBuildResponse{Body: io.NopCloser(strings.NewReader(""))}, nil + return build.ImageBuildResponse{Body: io.NopCloser(strings.NewReader(""))}, nil } diff --git a/cli/command/secret/client_test.go b/cli/command/secret/client_test.go index efcbccfeba..1b5a04c605 100644 --- a/cli/command/secret/client_test.go +++ b/cli/command/secret/client_test.go @@ -3,24 +3,23 @@ package secret import ( "context" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" ) type fakeClient struct { client.Client - secretCreateFunc func(context.Context, swarm.SecretSpec) (types.SecretCreateResponse, error) + secretCreateFunc func(context.Context, swarm.SecretSpec) (swarm.SecretCreateResponse, error) secretInspectFunc func(context.Context, string) (swarm.Secret, []byte, error) - secretListFunc func(context.Context, types.SecretListOptions) ([]swarm.Secret, error) + secretListFunc func(context.Context, swarm.SecretListOptions) ([]swarm.Secret, error) secretRemoveFunc func(context.Context, string) error } -func (c *fakeClient) SecretCreate(ctx context.Context, spec swarm.SecretSpec) (types.SecretCreateResponse, error) { +func (c *fakeClient) SecretCreate(ctx context.Context, spec swarm.SecretSpec) (swarm.SecretCreateResponse, error) { if c.secretCreateFunc != nil { return c.secretCreateFunc(ctx, spec) } - return types.SecretCreateResponse{}, nil + return swarm.SecretCreateResponse{}, nil } func (c *fakeClient) SecretInspectWithRaw(ctx context.Context, id string) (swarm.Secret, []byte, error) { @@ -30,7 +29,7 @@ func (c *fakeClient) SecretInspectWithRaw(ctx context.Context, id string) (swarm return swarm.Secret{}, nil, nil } -func (c *fakeClient) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { +func (c *fakeClient) SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { if c.secretListFunc != nil { return c.secretListFunc(ctx, options) } diff --git a/cli/command/secret/cmd.go b/cli/command/secret/cmd.go index 1d3a8304e8..f31348a7e8 100644 --- a/cli/command/secret/cmd.go +++ b/cli/command/secret/cmd.go @@ -4,7 +4,7 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command/completion" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" "github.com/spf13/cobra" ) @@ -32,7 +32,7 @@ func NewSecretCommand(dockerCli command.Cli) *cobra.Command { // completeNames offers completion for swarm secrets func completeNames(dockerCLI completion.APIClientProvider) cobra.CompletionFunc { return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - list, err := dockerCLI.Client().SecretList(cmd.Context(), types.SecretListOptions{}) + list, err := dockerCLI.Client().SecretList(cmd.Context(), swarm.SecretListOptions{}) if err != nil { return nil, cobra.ShellCompDirectiveError } diff --git a/cli/command/secret/create_test.go b/cli/command/secret/create_test.go index 17520728c4..cb5b897a54 100644 --- a/cli/command/secret/create_test.go +++ b/cli/command/secret/create_test.go @@ -12,7 +12,6 @@ import ( "testing" "github.com/docker/cli/internal/test" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" @@ -23,7 +22,7 @@ const secretDataFile = "secret-create-with-name.golden" func TestSecretCreateErrors(t *testing.T) { testCases := []struct { args []string - secretCreateFunc func(context.Context, swarm.SecretSpec) (types.SecretCreateResponse, error) + secretCreateFunc func(context.Context, swarm.SecretSpec) (swarm.SecretCreateResponse, error) expectedError string }{ { @@ -36,8 +35,8 @@ func TestSecretCreateErrors(t *testing.T) { }, { args: []string{"name", filepath.Join("testdata", secretDataFile)}, - secretCreateFunc: func(_ context.Context, secretSpec swarm.SecretSpec) (types.SecretCreateResponse, error) { - return types.SecretCreateResponse{}, errors.New("error creating secret") + secretCreateFunc: func(_ context.Context, secretSpec swarm.SecretSpec) (swarm.SecretCreateResponse, error) { + return swarm.SecretCreateResponse{}, errors.New("error creating secret") }, expectedError: "error creating secret", }, @@ -69,11 +68,11 @@ func TestSecretCreateWithName(t *testing.T) { } cli := test.NewFakeCli(&fakeClient{ - secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (types.SecretCreateResponse, error) { + secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (swarm.SecretCreateResponse, error) { if !reflect.DeepEqual(spec, expected) { - return types.SecretCreateResponse{}, fmt.Errorf("expected %+v, got %+v", expected, spec) + return swarm.SecretCreateResponse{}, fmt.Errorf("expected %+v, got %+v", expected, spec) } - return types.SecretCreateResponse{ + return swarm.SecretCreateResponse{ ID: "ID-" + spec.Name, }, nil }, @@ -92,16 +91,16 @@ func TestSecretCreateWithDriver(t *testing.T) { const name = "secret-with-driver" cli := test.NewFakeCli(&fakeClient{ - secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (types.SecretCreateResponse, error) { + secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (swarm.SecretCreateResponse, error) { if spec.Name != name { - return types.SecretCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) + return swarm.SecretCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) } if spec.Driver.Name != expectedDriver.Name { - return types.SecretCreateResponse{}, fmt.Errorf("expected driver %v, got %v", expectedDriver, spec.Labels) + return swarm.SecretCreateResponse{}, fmt.Errorf("expected driver %v, got %v", expectedDriver, spec.Labels) } - return types.SecretCreateResponse{ + return swarm.SecretCreateResponse{ ID: "ID-" + spec.Name, }, nil }, @@ -121,16 +120,16 @@ func TestSecretCreateWithTemplatingDriver(t *testing.T) { const name = "secret-with-template-driver" cli := test.NewFakeCli(&fakeClient{ - secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (types.SecretCreateResponse, error) { + secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (swarm.SecretCreateResponse, error) { if spec.Name != name { - return types.SecretCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) + return swarm.SecretCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) } if spec.Templating.Name != expectedDriver.Name { - return types.SecretCreateResponse{}, fmt.Errorf("expected driver %v, got %v", expectedDriver, spec.Labels) + return swarm.SecretCreateResponse{}, fmt.Errorf("expected driver %v, got %v", expectedDriver, spec.Labels) } - return types.SecretCreateResponse{ + return swarm.SecretCreateResponse{ ID: "ID-" + spec.Name, }, nil }, @@ -151,16 +150,16 @@ func TestSecretCreateWithLabels(t *testing.T) { const name = "secret-with-labels" cli := test.NewFakeCli(&fakeClient{ - secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (types.SecretCreateResponse, error) { + secretCreateFunc: func(_ context.Context, spec swarm.SecretSpec) (swarm.SecretCreateResponse, error) { if spec.Name != name { - return types.SecretCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) + return swarm.SecretCreateResponse{}, fmt.Errorf("expected name %q, got %q", name, spec.Name) } if !reflect.DeepEqual(spec.Labels, expectedLabels) { - return types.SecretCreateResponse{}, fmt.Errorf("expected labels %v, got %v", expectedLabels, spec.Labels) + return swarm.SecretCreateResponse{}, fmt.Errorf("expected labels %v, got %v", expectedLabels, spec.Labels) } - return types.SecretCreateResponse{ + return swarm.SecretCreateResponse{ ID: "ID-" + spec.Name, }, nil }, diff --git a/cli/command/secret/ls.go b/cli/command/secret/ls.go index 869e4f16d3..65d8f23e0e 100644 --- a/cli/command/secret/ls.go +++ b/cli/command/secret/ls.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/cli/command/formatter" flagsHelper "github.com/docker/cli/cli/flags" "github.com/docker/cli/opts" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/swarm" "github.com/fvbommel/sortorder" "github.com/spf13/cobra" ) @@ -47,7 +47,7 @@ func newSecretListCommand(dockerCli command.Cli) *cobra.Command { func runSecretList(ctx context.Context, dockerCli command.Cli, options listOptions) error { client := dockerCli.Client() - secrets, err := client.SecretList(ctx, types.SecretListOptions{Filters: options.filter.Value()}) + secrets, err := client.SecretList(ctx, swarm.SecretListOptions{Filters: options.filter.Value()}) if err != nil { return err } diff --git a/cli/command/secret/ls_test.go b/cli/command/secret/ls_test.go index 50272b02cb..bd21b8c945 100644 --- a/cli/command/secret/ls_test.go +++ b/cli/command/secret/ls_test.go @@ -10,7 +10,6 @@ import ( "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/internal/test" "github.com/docker/cli/internal/test/builders" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" @@ -20,7 +19,7 @@ import ( func TestSecretListErrors(t *testing.T) { testCases := []struct { args []string - secretListFunc func(context.Context, types.SecretListOptions) ([]swarm.Secret, error) + secretListFunc func(context.Context, swarm.SecretListOptions) ([]swarm.Secret, error) expectedError string }{ { @@ -28,7 +27,7 @@ func TestSecretListErrors(t *testing.T) { expectedError: "accepts no argument", }, { - secretListFunc: func(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { return []swarm.Secret{}, errors.New("error listing secrets") }, expectedError: "error listing secrets", @@ -49,7 +48,7 @@ func TestSecretListErrors(t *testing.T) { func TestSecretList(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { return []swarm.Secret{ *builders.Secret(builders.SecretID("ID-1-foo"), builders.SecretName("1-foo"), @@ -81,7 +80,7 @@ func TestSecretList(t *testing.T) { func TestSecretListWithQuietOption(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { return []swarm.Secret{ *builders.Secret(builders.SecretID("ID-foo"), builders.SecretName("foo")), *builders.Secret(builders.SecretID("ID-bar"), builders.SecretName("bar"), builders.SecretLabels(map[string]string{ @@ -98,7 +97,7 @@ func TestSecretListWithQuietOption(t *testing.T) { func TestSecretListWithConfigFormat(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { return []swarm.Secret{ *builders.Secret(builders.SecretID("ID-foo"), builders.SecretName("foo")), *builders.Secret(builders.SecretID("ID-bar"), builders.SecretName("bar"), builders.SecretLabels(map[string]string{ @@ -117,7 +116,7 @@ func TestSecretListWithConfigFormat(t *testing.T) { func TestSecretListWithFormat(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { return []swarm.Secret{ *builders.Secret(builders.SecretID("ID-foo"), builders.SecretName("foo")), *builders.Secret(builders.SecretID("ID-bar"), builders.SecretName("bar"), builders.SecretLabels(map[string]string{ @@ -134,7 +133,7 @@ func TestSecretListWithFormat(t *testing.T) { func TestSecretListWithFilter(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { assert.Check(t, is.Equal("foo", options.Filters.Get("name")[0]), "foo") assert.Check(t, is.Equal("lbl1=Label-bar", options.Filters.Get("label")[0])) return []swarm.Secret{ diff --git a/cli/command/service/create_test.go b/cli/command/service/create_test.go index 9ae4f2db45..1a478c930c 100644 --- a/cli/command/service/create_test.go +++ b/cli/command/service/create_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/docker/cli/opts/swarmopts" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" @@ -14,14 +13,14 @@ import ( // fakeConfigAPIClientList is used to let us pass a closure as a // ConfigAPIClient, to use as ConfigList. for all the other methods in the // interface, it does nothing, not even return an error, so don't use them -type fakeConfigAPIClientList func(context.Context, types.ConfigListOptions) ([]swarm.Config, error) +type fakeConfigAPIClientList func(context.Context, swarm.ConfigListOptions) ([]swarm.Config, error) -func (f fakeConfigAPIClientList) ConfigList(ctx context.Context, opts types.ConfigListOptions) ([]swarm.Config, error) { +func (f fakeConfigAPIClientList) ConfigList(ctx context.Context, opts swarm.ConfigListOptions) ([]swarm.Config, error) { return f(ctx, opts) } -func (fakeConfigAPIClientList) ConfigCreate(_ context.Context, _ swarm.ConfigSpec) (types.ConfigCreateResponse, error) { - return types.ConfigCreateResponse{}, nil +func (fakeConfigAPIClientList) ConfigCreate(_ context.Context, _ swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { + return swarm.ConfigCreateResponse{}, nil } func (fakeConfigAPIClientList) ConfigRemove(_ context.Context, _ string) error { @@ -67,7 +66,7 @@ func TestSetConfigsWithCredSpecAndConfigs(t *testing.T) { } // set up a function to use as the list function - var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts types.ConfigListOptions) ([]swarm.Config, error) { + var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts swarm.ConfigListOptions) ([]swarm.Config, error) { f := opts.Filters // we're expecting the filter to have names "foo" and "bar" @@ -147,7 +146,7 @@ func TestSetConfigsOnlyCredSpec(t *testing.T) { } // set up a function to use as the list function - var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts types.ConfigListOptions) ([]swarm.Config, error) { + var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts swarm.ConfigListOptions) ([]swarm.Config, error) { f := opts.Filters names := f.Get("name") @@ -198,7 +197,7 @@ func TestSetConfigsOnlyConfigs(t *testing.T) { }, } - var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts types.ConfigListOptions) ([]swarm.Config, error) { + var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts swarm.ConfigListOptions) ([]swarm.Config, error) { f := opts.Filters names := f.Get("name") @@ -259,7 +258,7 @@ func TestSetConfigsNoConfigs(t *testing.T) { }, } - var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts types.ConfigListOptions) ([]swarm.Config, error) { + var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts swarm.ConfigListOptions) ([]swarm.Config, error) { // assert false -- we should never call this function assert.Assert(t, false, "we should not be listing configs") return nil, nil diff --git a/cli/command/service/parse.go b/cli/command/service/parse.go index 239be18810..dcd4362171 100644 --- a/cli/command/service/parse.go +++ b/cli/command/service/parse.go @@ -3,7 +3,6 @@ package service import ( "context" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" @@ -33,7 +32,7 @@ func ParseSecrets(ctx context.Context, apiClient client.SecretAPIClient, request args.Add("name", s.SecretName) } - secrets, err := apiClient.SecretList(ctx, types.SecretListOptions{ + secrets, err := apiClient.SecretList(ctx, swarmtypes.SecretListOptions{ Filters: args, }) if err != nil { @@ -113,7 +112,7 @@ func ParseConfigs(ctx context.Context, apiClient client.ConfigAPIClient, request args.Add("name", s.ConfigName) } - configs, err := apiClient.ConfigList(ctx, types.ConfigListOptions{ + configs, err := apiClient.ConfigList(ctx, swarmtypes.ConfigListOptions{ Filters: args, }) if err != nil { diff --git a/cli/command/service/update_test.go b/cli/command/service/update_test.go index 2ace1e2c24..d022b0c3d5 100644 --- a/cli/command/service/update_test.go +++ b/cli/command/service/update_test.go @@ -8,7 +8,6 @@ import ( "testing" "time" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" mounttypes "github.com/docker/docker/api/types/mount" "github.com/docker/docker/api/types/network" @@ -504,12 +503,12 @@ type secretAPIClientMock struct { listResult []swarm.Secret } -func (s secretAPIClientMock) SecretList(context.Context, types.SecretListOptions) ([]swarm.Secret, error) { +func (s secretAPIClientMock) SecretList(context.Context, swarm.SecretListOptions) ([]swarm.Secret, error) { return s.listResult, nil } -func (secretAPIClientMock) SecretCreate(context.Context, swarm.SecretSpec) (types.SecretCreateResponse, error) { - return types.SecretCreateResponse{}, nil +func (secretAPIClientMock) SecretCreate(context.Context, swarm.SecretSpec) (swarm.SecretCreateResponse, error) { + return swarm.SecretCreateResponse{}, nil } func (secretAPIClientMock) SecretRemove(context.Context, string) error { @@ -1203,7 +1202,7 @@ func TestUpdateGetUpdatedConfigs(t *testing.T) { // fakeConfigAPIClientList is actually defined in create_test.go, // but we'll use it here as well - var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts types.ConfigListOptions) ([]swarm.Config, error) { + var fakeClient fakeConfigAPIClientList = func(_ context.Context, opts swarm.ConfigListOptions) ([]swarm.Config, error) { names := opts.Filters.Get("name") assert.Equal(t, len(names), len(tc.lookupConfigs)) diff --git a/cli/command/stack/client_test.go b/cli/command/stack/client_test.go index ea1ed02a4d..d1755e7cda 100644 --- a/cli/command/stack/client_test.go +++ b/cli/command/stack/client_test.go @@ -30,8 +30,8 @@ type fakeClient struct { serviceListFunc func(options types.ServiceListOptions) ([]swarm.Service, error) networkListFunc func(options network.ListOptions) ([]network.Summary, error) - secretListFunc func(options types.SecretListOptions) ([]swarm.Secret, error) - configListFunc func(options types.ConfigListOptions) ([]swarm.Config, error) + secretListFunc func(options swarm.SecretListOptions) ([]swarm.Secret, error) + configListFunc func(options swarm.ConfigListOptions) ([]swarm.Config, error) nodeListFunc func(options types.NodeListOptions) ([]swarm.Node, error) taskListFunc func(options types.TaskListOptions) ([]swarm.Task, error) nodeInspectWithRaw func(ref string) (swarm.Node, []byte, error) @@ -85,7 +85,7 @@ func (cli *fakeClient) NetworkList(_ context.Context, options network.ListOption return networksList, nil } -func (cli *fakeClient) SecretList(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { +func (cli *fakeClient) SecretList(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { if cli.secretListFunc != nil { return cli.secretListFunc(options) } @@ -100,7 +100,7 @@ func (cli *fakeClient) SecretList(_ context.Context, options types.SecretListOpt return secretsList, nil } -func (cli *fakeClient) ConfigList(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { +func (cli *fakeClient) ConfigList(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { if cli.configListFunc != nil { return cli.configListFunc(options) } diff --git a/cli/command/stack/swarm/client_test.go b/cli/command/stack/swarm/client_test.go index 28f6aac35c..525651bae2 100644 --- a/cli/command/stack/swarm/client_test.go +++ b/cli/command/stack/swarm/client_test.go @@ -30,8 +30,8 @@ type fakeClient struct { serviceListFunc func(options types.ServiceListOptions) ([]swarm.Service, error) networkListFunc func(options network.ListOptions) ([]network.Summary, error) - secretListFunc func(options types.SecretListOptions) ([]swarm.Secret, error) - configListFunc func(options types.ConfigListOptions) ([]swarm.Config, error) + secretListFunc func(options swarm.SecretListOptions) ([]swarm.Secret, error) + configListFunc func(options swarm.ConfigListOptions) ([]swarm.Config, error) nodeListFunc func(options types.NodeListOptions) ([]swarm.Node, error) taskListFunc func(options types.TaskListOptions) ([]swarm.Task, error) nodeInspectWithRaw func(ref string) (swarm.Node, []byte, error) @@ -85,7 +85,7 @@ func (cli *fakeClient) NetworkList(_ context.Context, options network.ListOption return networksList, nil } -func (cli *fakeClient) SecretList(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { +func (cli *fakeClient) SecretList(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { if cli.secretListFunc != nil { return cli.secretListFunc(options) } @@ -100,7 +100,7 @@ func (cli *fakeClient) SecretList(_ context.Context, options types.SecretListOpt return secretsList, nil } -func (cli *fakeClient) ConfigList(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { +func (cli *fakeClient) ConfigList(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { if cli.configListFunc != nil { return cli.configListFunc(options) } diff --git a/cli/command/stack/swarm/common.go b/cli/command/stack/swarm/common.go index 06fbc3abe2..45af48b5fe 100644 --- a/cli/command/stack/swarm/common.go +++ b/cli/command/stack/swarm/common.go @@ -39,11 +39,11 @@ func getStackNetworks(ctx context.Context, apiclient client.APIClient, namespace } func getStackSecrets(ctx context.Context, apiclient client.APIClient, namespace string) ([]swarm.Secret, error) { - return apiclient.SecretList(ctx, types.SecretListOptions{Filters: getStackFilter(namespace)}) + return apiclient.SecretList(ctx, swarm.SecretListOptions{Filters: getStackFilter(namespace)}) } func getStackConfigs(ctx context.Context, apiclient client.APIClient, namespace string) ([]swarm.Config, error) { - return apiclient.ConfigList(ctx, types.ConfigListOptions{Filters: getStackFilter(namespace)}) + return apiclient.ConfigList(ctx, swarm.ConfigListOptions{Filters: getStackFilter(namespace)}) } func getStackTasks(ctx context.Context, apiclient client.APIClient, namespace string) ([]swarm.Task, error) { diff --git a/cli/compose/convert/service_test.go b/cli/compose/convert/service_test.go index 3cf58d1992..a5c1239ea4 100644 --- a/cli/compose/convert/service_test.go +++ b/cli/compose/convert/service_test.go @@ -9,7 +9,6 @@ import ( "time" composetypes "github.com/docker/cli/cli/compose/types" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" @@ -514,7 +513,7 @@ func TestConvertServiceSecrets(t *testing.T) { }, } apiClient := &fakeClient{ - secretListFunc: func(opts types.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(opts swarm.SecretListOptions) ([]swarm.Secret, error) { assert.Check(t, is.Contains(opts.Filters.Get("name"), "foo_secret")) assert.Check(t, is.Contains(opts.Filters.Get("name"), "bar_secret")) return []swarm.Secret{ @@ -572,7 +571,7 @@ func TestConvertServiceConfigs(t *testing.T) { }, } apiClient := &fakeClient{ - configListFunc: func(opts types.ConfigListOptions) ([]swarm.Config, error) { + configListFunc: func(opts swarm.ConfigListOptions) ([]swarm.Config, error) { assert.Check(t, is.Contains(opts.Filters.Get("name"), "foo_config")) assert.Check(t, is.Contains(opts.Filters.Get("name"), "bar_config")) assert.Check(t, is.Contains(opts.Filters.Get("name"), "baz_config")) @@ -615,18 +614,18 @@ func TestConvertServiceConfigs(t *testing.T) { type fakeClient struct { client.Client - secretListFunc func(types.SecretListOptions) ([]swarm.Secret, error) - configListFunc func(types.ConfigListOptions) ([]swarm.Config, error) + secretListFunc func(swarm.SecretListOptions) ([]swarm.Secret, error) + configListFunc func(swarm.ConfigListOptions) ([]swarm.Config, error) } -func (c *fakeClient) SecretList(_ context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { +func (c *fakeClient) SecretList(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { if c.secretListFunc != nil { return c.secretListFunc(options) } return []swarm.Secret{}, nil } -func (c *fakeClient) ConfigList(_ context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { +func (c *fakeClient) ConfigList(_ context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { if c.configListFunc != nil { return c.configListFunc(options) } diff --git a/cmd/docker/builder.go b/cmd/docker/builder.go index ac988456b3..cccae304fe 100644 --- a/cmd/docker/builder.go +++ b/cmd/docker/builder.go @@ -11,7 +11,7 @@ import ( pluginmanager "github.com/docker/cli/cli-plugins/manager" "github.com/docker/cli/cli-plugins/metadata" "github.com/docker/cli/cli/command" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -88,7 +88,7 @@ func processBuilder(dockerCli command.Cli, cmd *cobra.Command, args, osargs []st // Builder is not explicitly configured as an alias for buildx. // Detect whether we should use BuildKit, or fallback to the // legacy builder. - if si := dockerCli.ServerInfo(); si.BuildkitVersion != types.BuilderBuildKit && si.OSType == "windows" { + if si := dockerCli.ServerInfo(); si.BuildkitVersion != build.BuilderBuildKit && si.OSType == "windows" { // The daemon didn't advertise BuildKit as the preferred builder, // so use the legacy builder, which is still the default for // Windows / WCOW. diff --git a/vendor.mod b/vendor.mod index 61f18633be..46273738ec 100644 --- a/vendor.mod +++ b/vendor.mod @@ -15,7 +15,7 @@ require ( github.com/distribution/reference v0.6.0 github.com/docker/cli-docs-tool v0.9.0 github.com/docker/distribution v2.8.3+incompatible - github.com/docker/docker v28.1.2-0.20250516190044-4b9f0707a039+incompatible // master, v28.x dev + github.com/docker/docker v28.1.2-0.20250519114040-7937f0846c13+incompatible // master, v28.x dev github.com/docker/docker-credential-helpers v0.9.3 github.com/docker/go-connections v0.5.0 github.com/docker/go-units v0.5.0 diff --git a/vendor.sum b/vendor.sum index 25272a4872..3d2bac65cb 100644 --- a/vendor.sum +++ b/vendor.sum @@ -55,8 +55,8 @@ github.com/docker/cli-docs-tool v0.9.0/go.mod h1:ClrwlNW+UioiRyH9GiAOe1o3J/TsY3T github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v28.1.2-0.20250516190044-4b9f0707a039+incompatible h1:+0S3GrDZj0nbBqBWDlFqTJzV0u3lXxvyuhRxRDGtzKs= -github.com/docker/docker v28.1.2-0.20250516190044-4b9f0707a039+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.1.2-0.20250519114040-7937f0846c13+incompatible h1:hQ0dI0strJB2gjh/Sx+WthVEhOe89DPjAwiZVwjbpIg= +github.com/docker/docker v28.1.2-0.20250519114040-7937f0846c13+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= diff --git a/vendor/github.com/docker/docker/api/types/build/build.go b/vendor/github.com/docker/docker/api/types/build/build.go new file mode 100644 index 0000000000..c43a0e21ea --- /dev/null +++ b/vendor/github.com/docker/docker/api/types/build/build.go @@ -0,0 +1,91 @@ +package build + +import ( + "io" + + "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/registry" +) + +// BuilderVersion sets the version of underlying builder to use +type BuilderVersion string + +const ( + // BuilderV1 is the first generation builder in docker daemon + BuilderV1 BuilderVersion = "1" + // BuilderBuildKit is builder based on moby/buildkit project + BuilderBuildKit BuilderVersion = "2" +) + +// Result contains the image id of a successful build. +type Result struct { + ID string +} + +// ImageBuildOptions holds the information +// necessary to build images. +type ImageBuildOptions struct { + Tags []string + SuppressOutput bool + RemoteContext string + NoCache bool + Remove bool + ForceRemove bool + PullParent bool + Isolation container.Isolation + CPUSetCPUs string + CPUSetMems string + CPUShares int64 + CPUQuota int64 + CPUPeriod int64 + Memory int64 + MemorySwap int64 + CgroupParent string + NetworkMode string + ShmSize int64 + Dockerfile string + Ulimits []*container.Ulimit + // BuildArgs needs to be a *string instead of just a string so that + // we can tell the difference between "" (empty string) and no value + // at all (nil). See the parsing of buildArgs in + // api/server/router/build/build_routes.go for even more info. + BuildArgs map[string]*string + AuthConfigs map[string]registry.AuthConfig + Context io.Reader + Labels map[string]string + // squash the resulting image's layers to the parent + // preserves the original image and creates a new one from the parent with all + // the changes applied to a single layer + Squash bool + // CacheFrom specifies images that are used for matching cache. Images + // specified here do not need to have a valid parent chain to match cache. + CacheFrom []string + SecurityOpt []string + ExtraHosts []string // List of extra hosts + Target string + SessionID string + Platform string + // Version specifies the version of the underlying builder to use + Version BuilderVersion + // BuildID is an optional identifier that can be passed together with the + // build request. The same identifier can be used to gracefully cancel the + // build with the cancel request. + BuildID string + // Outputs defines configurations for exporting build results. Only supported + // in BuildKit mode + Outputs []ImageBuildOutput +} + +// ImageBuildOutput defines configuration for exporting a build result +type ImageBuildOutput struct { + Type string + Attrs map[string]string +} + +// ImageBuildResponse holds information +// returned by a server after building +// an image. +type ImageBuildResponse struct { + Body io.ReadCloser + OSType string +} diff --git a/vendor/github.com/docker/docker/api/types/client.go b/vendor/github.com/docker/docker/api/types/client.go index dce8260f32..b182c060cf 100644 --- a/vendor/github.com/docker/docker/api/types/client.go +++ b/vendor/github.com/docker/docker/api/types/client.go @@ -3,12 +3,9 @@ package types // import "github.com/docker/docker/api/types" import ( "bufio" "context" - "io" "net" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" - "github.com/docker/docker/api/types/registry" ) // NewHijackedResponse initializes a [HijackedResponse] type. @@ -51,84 +48,6 @@ func (h *HijackedResponse) CloseWrite() error { return nil } -// ImageBuildOptions holds the information -// necessary to build images. -type ImageBuildOptions struct { - Tags []string - SuppressOutput bool - RemoteContext string - NoCache bool - Remove bool - ForceRemove bool - PullParent bool - Isolation container.Isolation - CPUSetCPUs string - CPUSetMems string - CPUShares int64 - CPUQuota int64 - CPUPeriod int64 - Memory int64 - MemorySwap int64 - CgroupParent string - NetworkMode string - ShmSize int64 - Dockerfile string - Ulimits []*container.Ulimit - // BuildArgs needs to be a *string instead of just a string so that - // we can tell the difference between "" (empty string) and no value - // at all (nil). See the parsing of buildArgs in - // api/server/router/build/build_routes.go for even more info. - BuildArgs map[string]*string - AuthConfigs map[string]registry.AuthConfig - Context io.Reader - Labels map[string]string - // squash the resulting image's layers to the parent - // preserves the original image and creates a new one from the parent with all - // the changes applied to a single layer - Squash bool - // CacheFrom specifies images that are used for matching cache. Images - // specified here do not need to have a valid parent chain to match cache. - CacheFrom []string - SecurityOpt []string - ExtraHosts []string // List of extra hosts - Target string - SessionID string - Platform string - // Version specifies the version of the underlying builder to use - Version BuilderVersion - // BuildID is an optional identifier that can be passed together with the - // build request. The same identifier can be used to gracefully cancel the - // build with the cancel request. - BuildID string - // Outputs defines configurations for exporting build results. Only supported - // in BuildKit mode - Outputs []ImageBuildOutput -} - -// ImageBuildOutput defines configuration for exporting a build result -type ImageBuildOutput struct { - Type string - Attrs map[string]string -} - -// BuilderVersion sets the version of underlying builder to use -type BuilderVersion string - -const ( - // BuilderV1 is the first generation builder in docker daemon - BuilderV1 BuilderVersion = "1" - // BuilderBuildKit is builder based on moby/buildkit project - BuilderBuildKit BuilderVersion = "2" -) - -// ImageBuildResponse holds information -// returned by a server after building -// an image. -type ImageBuildResponse struct { - Body io.ReadCloser - OSType string -} - // NodeListOptions holds parameters to list nodes with. type NodeListOptions struct { Filters filters.Args diff --git a/vendor/github.com/docker/docker/api/types/swarm/config.go b/vendor/github.com/docker/docker/api/types/swarm/config.go index f9a65187ff..bdec82ffbd 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/config.go +++ b/vendor/github.com/docker/docker/api/types/swarm/config.go @@ -1,6 +1,10 @@ package swarm // import "github.com/docker/docker/api/types/swarm" -import "os" +import ( + "os" + + "github.com/docker/docker/api/types/filters" +) // Config represents a config. type Config struct { @@ -44,3 +48,15 @@ type ConfigReference struct { ConfigID string ConfigName string } + +// ConfigCreateResponse contains the information returned to a client +// on the creation of a new config. +type ConfigCreateResponse struct { + // ID is the id of the created config. + ID string +} + +// ConfigListOptions holds parameters to list configs +type ConfigListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/docker/docker/api/types/swarm/secret.go b/vendor/github.com/docker/docker/api/types/swarm/secret.go index aeb5bb54ad..248cffab8e 100644 --- a/vendor/github.com/docker/docker/api/types/swarm/secret.go +++ b/vendor/github.com/docker/docker/api/types/swarm/secret.go @@ -1,6 +1,10 @@ package swarm // import "github.com/docker/docker/api/types/swarm" -import "os" +import ( + "os" + + "github.com/docker/docker/api/types/filters" +) // Secret represents a secret. type Secret struct { @@ -48,3 +52,15 @@ type SecretReference struct { SecretID string SecretName string } + +// SecretCreateResponse contains the information returned to a client +// on the creation of a new secret. +type SecretCreateResponse struct { + // ID is the id of the created secret. + ID string +} + +// SecretListOptions holds parameters to list secrets +type SecretListOptions struct { + Filters filters.Args +} diff --git a/vendor/github.com/docker/docker/api/types/types.go b/vendor/github.com/docker/docker/api/types/types.go index 891fe80bdf..443cf82a93 100644 --- a/vendor/github.com/docker/docker/api/types/types.go +++ b/vendor/github.com/docker/docker/api/types/types.go @@ -3,7 +3,6 @@ package types // import "github.com/docker/docker/api/types" import ( "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/api/types/volume" @@ -23,7 +22,7 @@ type Ping struct { APIVersion string OSType string Experimental bool - BuilderVersion BuilderVersion + BuilderVersion build.BuilderVersion // SwarmStatus provides information about the current swarm status of the // engine, obtained from the "Swarm" header in the API response. @@ -94,30 +93,6 @@ type DiskUsage struct { BuilderSize int64 `json:",omitempty"` // Deprecated: deprecated in API 1.38, and no longer used since API 1.40. } -// SecretCreateResponse contains the information returned to a client -// on the creation of a new secret. -type SecretCreateResponse struct { - // ID is the id of the created secret. - ID string -} - -// SecretListOptions holds parameters to list secrets -type SecretListOptions struct { - Filters filters.Args -} - -// ConfigCreateResponse contains the information returned to a client -// on the creation of a new config. -type ConfigCreateResponse struct { - // ID is the id of the created config. - ID string -} - -// ConfigListOptions holds parameters to list configs -type ConfigListOptions struct { - Filters filters.Args -} - // PushResult contains the tag, manifest digest, and manifest size from the // push. It's used to signal this information to the trust code in the client // so it can sign the manifest if necessary. @@ -126,8 +101,3 @@ type PushResult struct { Digest string Size int } - -// BuildResult contains the image id of a successful build -type BuildResult struct { - ID string -} diff --git a/vendor/github.com/docker/docker/api/types/types_deprecated.go b/vendor/github.com/docker/docker/api/types/types_deprecated.go index c3886841db..6d2a782adc 100644 --- a/vendor/github.com/docker/docker/api/types/types_deprecated.go +++ b/vendor/github.com/docker/docker/api/types/types_deprecated.go @@ -8,6 +8,7 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/image" "github.com/docker/docker/api/types/storage" + "github.com/docker/docker/api/types/swarm" ) // IDResponse Response to an API call that returns just an Id. @@ -115,6 +116,28 @@ type ImageInspect = image.InspectResponse // Deprecated: moved to [github.com/docker/docker/api/types/registry.RequestAuthConfig]. type RequestPrivilegeFunc func(context.Context) (string, error) +// SecretCreateResponse contains the information returned to a client +// on the creation of a new secret. +// +// Deprecated: use [swarm.SecretCreateResponse]. +type SecretCreateResponse = swarm.SecretCreateResponse + +// SecretListOptions holds parameters to list secrets +// +// Deprecated: use [swarm.SecretListOptions]. +type SecretListOptions = swarm.SecretListOptions + +// ConfigCreateResponse contains the information returned to a client +// on the creation of a new config. +// +// Deprecated: use [swarm.ConfigCreateResponse]. +type ConfigCreateResponse = swarm.ConfigCreateResponse + +// ConfigListOptions holds parameters to list configs +// +// Deprecated: use [swarm.ConfigListOptions]. +type ConfigListOptions = swarm.ConfigListOptions + // BuildCache contains information about a build cache record. // // Deprecated: deprecated in API 1.49. Use [build.CacheRecord] instead. @@ -130,3 +153,42 @@ type BuildCachePruneOptions = build.CachePruneOptions // // Deprecated: use [build.CachePruneReport]. type BuildCachePruneReport = build.CachePruneReport + +// BuildResult contains the image id of a successful build/ +// +// Deprecated: use [build.Result]. +type BuildResult = build.Result + +// ImageBuildOptions holds the information +// necessary to build images. +// +// Deprecated: use [build.ImageBuildOptions]. +type ImageBuildOptions = build.ImageBuildOptions + +// ImageBuildOutput defines configuration for exporting a build result +// +// Deprecated: use [build.ImageBuildOutput]. +type ImageBuildOutput = build.ImageBuildOutput + +// ImageBuildResponse holds information +// returned by a server after building +// an image. +// +// Deprecated: use [build.ImageBuildResponse]. +type ImageBuildResponse = build.ImageBuildResponse + +// BuilderVersion sets the version of underlying builder to use +// +// Deprecated: use [build.BuilderVersion]. +type BuilderVersion = build.BuilderVersion + +const ( + // BuilderV1 is the first generation builder in docker daemon + // + // Deprecated: use [build.BuilderV1]. + BuilderV1 = build.BuilderV1 + // BuilderBuildKit is builder based on moby/buildkit project + // + // Deprecated: use [build.BuilderBuildKit]. + BuilderBuildKit = build.BuilderBuildKit +) diff --git a/vendor/github.com/docker/docker/client/client_interfaces.go b/vendor/github.com/docker/docker/client/client_interfaces.go index 2ade8572a8..bc25c28b6a 100644 --- a/vendor/github.com/docker/docker/client/client_interfaces.go +++ b/vendor/github.com/docker/docker/client/client_interfaces.go @@ -110,7 +110,7 @@ type DistributionAPIClient interface { // ImageAPIClient defines API client methods for the images type ImageAPIClient interface { - ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) + ImageBuild(ctx context.Context, context io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) BuildCachePrune(ctx context.Context, opts build.CachePruneOptions) (*build.CachePruneReport, error) BuildCancel(ctx context.Context, id string) error ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) @@ -220,8 +220,8 @@ type VolumeAPIClient interface { // SecretAPIClient defines API client methods for secrets type SecretAPIClient interface { - SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) - SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) + SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) + SecretCreate(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error) SecretRemove(ctx context.Context, id string) error SecretInspectWithRaw(ctx context.Context, name string) (swarm.Secret, []byte, error) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error @@ -229,8 +229,8 @@ type SecretAPIClient interface { // ConfigAPIClient defines API client methods for configs type ConfigAPIClient interface { - ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) - ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) + ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) + ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) ConfigRemove(ctx context.Context, id string) error ConfigInspectWithRaw(ctx context.Context, name string) (swarm.Config, []byte, error) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error diff --git a/vendor/github.com/docker/docker/client/config_create.go b/vendor/github.com/docker/docker/client/config_create.go index c7ea6d2eba..1fbfc21f92 100644 --- a/vendor/github.com/docker/docker/client/config_create.go +++ b/vendor/github.com/docker/docker/client/config_create.go @@ -4,13 +4,12 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" ) // ConfigCreate creates a new config. -func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) { - var response types.ConfigCreateResponse +func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (swarm.ConfigCreateResponse, error) { + var response swarm.ConfigCreateResponse if err := cli.NewVersionError(ctx, "1.30", "config create"); err != nil { return response, err } diff --git a/vendor/github.com/docker/docker/client/config_list.go b/vendor/github.com/docker/docker/client/config_list.go index 7e4a8ea567..67779e98aa 100644 --- a/vendor/github.com/docker/docker/client/config_list.go +++ b/vendor/github.com/docker/docker/client/config_list.go @@ -5,13 +5,12 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" ) // ConfigList returns the list of configs. -func (cli *Client) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { +func (cli *Client) ConfigList(ctx context.Context, options swarm.ConfigListOptions) ([]swarm.Config, error) { if err := cli.NewVersionError(ctx, "1.30", "config list"); err != nil { return nil, err } diff --git a/vendor/github.com/docker/docker/client/image_build.go b/vendor/github.com/docker/docker/client/image_build.go index 6e2a40687b..28b74a3f1a 100644 --- a/vendor/github.com/docker/docker/client/image_build.go +++ b/vendor/github.com/docker/docker/client/image_build.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" ) @@ -18,15 +18,15 @@ import ( // ImageBuild sends a request to the daemon to build images. // The Body in the response implements an io.ReadCloser and it's up to the caller to // close it. -func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) { +func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options build.ImageBuildOptions) (build.ImageBuildResponse, error) { query, err := cli.imageBuildOptionsToQuery(ctx, options) if err != nil { - return types.ImageBuildResponse{}, err + return build.ImageBuildResponse{}, err } buf, err := json.Marshal(options.AuthConfigs) if err != nil { - return types.ImageBuildResponse{}, err + return build.ImageBuildResponse{}, err } headers := http.Header{} @@ -35,16 +35,16 @@ func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, optio resp, err := cli.postRaw(ctx, "/build", query, buildContext, headers) if err != nil { - return types.ImageBuildResponse{}, err + return build.ImageBuildResponse{}, err } - return types.ImageBuildResponse{ + return build.ImageBuildResponse{ Body: resp.Body, OSType: getDockerOS(resp.Header.Get("Server")), }, nil } -func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.ImageBuildOptions) (url.Values, error) { +func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options build.ImageBuildOptions) (url.Values, error) { query := url.Values{} if len(options.Tags) > 0 { query["t"] = options.Tags diff --git a/vendor/github.com/docker/docker/client/ping.go b/vendor/github.com/docker/docker/client/ping.go index c7645e56d6..2ffa5945f4 100644 --- a/vendor/github.com/docker/docker/client/ping.go +++ b/vendor/github.com/docker/docker/client/ping.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/build" "github.com/docker/docker/api/types/swarm" ) @@ -67,7 +68,7 @@ func parsePingResponse(cli *Client, resp *http.Response) (types.Ping, error) { ping.Experimental = true } if bv := resp.Header.Get("Builder-Version"); bv != "" { - ping.BuilderVersion = types.BuilderVersion(bv) + ping.BuilderVersion = build.BuilderVersion(bv) } if si := resp.Header.Get("Swarm"); si != "" { state, role, _ := strings.Cut(si, "/") diff --git a/vendor/github.com/docker/docker/client/secret_create.go b/vendor/github.com/docker/docker/client/secret_create.go index bbd1191877..aee051b902 100644 --- a/vendor/github.com/docker/docker/client/secret_create.go +++ b/vendor/github.com/docker/docker/client/secret_create.go @@ -4,22 +4,21 @@ import ( "context" "encoding/json" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" ) // SecretCreate creates a new secret. -func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { +func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (swarm.SecretCreateResponse, error) { if err := cli.NewVersionError(ctx, "1.25", "secret create"); err != nil { - return types.SecretCreateResponse{}, err + return swarm.SecretCreateResponse{}, err } resp, err := cli.post(ctx, "/secrets/create", nil, secret, nil) defer ensureReaderClosed(resp) if err != nil { - return types.SecretCreateResponse{}, err + return swarm.SecretCreateResponse{}, err } - var response types.SecretCreateResponse + var response swarm.SecretCreateResponse err = json.NewDecoder(resp.Body).Decode(&response) return response, err } diff --git a/vendor/github.com/docker/docker/client/secret_list.go b/vendor/github.com/docker/docker/client/secret_list.go index e3b7dbdb9e..b158d99ed9 100644 --- a/vendor/github.com/docker/docker/client/secret_list.go +++ b/vendor/github.com/docker/docker/client/secret_list.go @@ -5,13 +5,12 @@ import ( "encoding/json" "net/url" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" ) // SecretList returns the list of secrets. -func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { +func (cli *Client) SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { if err := cli.NewVersionError(ctx, "1.25", "secret list"); err != nil { return nil, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 0ff87f19fc..27ac6d9d80 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -61,7 +61,7 @@ github.com/docker/distribution/registry/client/transport github.com/docker/distribution/registry/storage/cache github.com/docker/distribution/registry/storage/cache/memory github.com/docker/distribution/uuid -# github.com/docker/docker v28.1.2-0.20250516190044-4b9f0707a039+incompatible +# github.com/docker/docker v28.1.2-0.20250519114040-7937f0846c13+incompatible ## explicit github.com/docker/docker/api github.com/docker/docker/api/types