From 10072c35480b8318ef0cddb3619ec7721703a9cf Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 27 Aug 2025 09:36:11 +0200 Subject: [PATCH] vendor: github.com/moby/moby/api, github.com/moby/moby/client 62884141100c full diffs: - https://github.com/moby/moby/compare/7145e7666b8f...62884141100c14533299913efff3ead968ce6c3b Signed-off-by: Sebastiaan van Stijn --- cli/command/completion/functions.go | 5 +- cli/command/completion/functions_test.go | 6 +- cli/command/container/client_test.go | 5 +- cli/command/container/create.go | 3 +- cli/command/container/create_test.go | 4 +- cli/command/container/run_test.go | 3 +- cli/command/image/client_test.go | 22 ++-- cli/command/image/import.go | 12 +- cli/command/image/import_test.go | 16 +-- cli/command/image/list.go | 3 +- cli/command/image/list_test.go | 11 +- cli/command/image/pull_test.go | 6 +- cli/command/image/push.go | 4 +- cli/command/image/push_test.go | 8 +- cli/command/image/remove.go | 4 +- cli/command/image/remove_test.go | 17 +-- cli/command/image/tree.go | 3 +- cli/command/image/trust.go | 14 +- cli/command/secret/client_test.go | 4 +- cli/command/secret/cmd.go | 4 +- cli/command/secret/ls.go | 4 +- cli/command/secret/ls_test.go | 15 ++- cli/command/service/parse.go | 2 +- cli/command/service/update_test.go | 2 +- cli/command/stack/client_test.go | 4 +- cli/command/stack/swarm/client_test.go | 4 +- cli/command/stack/swarm/common.go | 2 +- cli/command/system/client_test.go | 4 +- cli/command/system/completion.go | 3 +- cli/command/system/completion_test.go | 4 +- cli/command/trust/inspect_pretty_test.go | 2 +- cli/command/trust/sign.go | 3 +- cli/compose/convert/service_test.go | 6 +- vendor.mod | 4 +- vendor.sum | 8 +- .../moby/moby/api/types/image/opts.go | 124 ------------------ .../moby/moby/api/types/swarm/secret.go | 7 - .../moby/moby/client/client_interfaces.go | 14 +- .../moby/moby/client/image_create.go | 3 +- .../moby/moby/client/image_create_opts.go | 7 + .../moby/moby/client/image_history_opts.go | 11 +- .../moby/moby/client/image_import.go | 3 +- .../moby/moby/client/image_import_opts.go | 19 +++ .../moby/moby/client/image_inspect_opts.go | 15 ++- .../github.com/moby/moby/client/image_list.go | 2 +- .../moby/moby/client/image_list_opts.go | 24 ++++ .../moby/moby/client/image_load_opts.go | 12 +- .../github.com/moby/moby/client/image_pull.go | 3 +- .../moby/moby/client/image_pull_opts.go | 18 +++ .../github.com/moby/moby/client/image_push.go | 3 +- .../moby/moby/client/image_push_opts.go | 26 ++++ .../moby/moby/client/image_remove.go | 2 +- .../moby/moby/client/image_remove_opts.go | 10 ++ .../moby/moby/client/image_save_opts.go | 9 +- .../moby/moby/client/secret_list.go | 2 +- .../moby/moby/client/secret_list_opts.go | 8 ++ vendor/modules.txt | 4 +- 57 files changed, 274 insertions(+), 273 deletions(-) delete mode 100644 vendor/github.com/moby/moby/api/types/image/opts.go create mode 100644 vendor/github.com/moby/moby/client/image_create_opts.go create mode 100644 vendor/github.com/moby/moby/client/image_import_opts.go create mode 100644 vendor/github.com/moby/moby/client/image_list_opts.go create mode 100644 vendor/github.com/moby/moby/client/image_pull_opts.go create mode 100644 vendor/github.com/moby/moby/client/image_push_opts.go create mode 100644 vendor/github.com/moby/moby/client/image_remove_opts.go create mode 100644 vendor/github.com/moby/moby/client/secret_list_opts.go diff --git a/cli/command/completion/functions.go b/cli/command/completion/functions.go index c2e186406..8b12d37f8 100644 --- a/cli/command/completion/functions.go +++ b/cli/command/completion/functions.go @@ -6,12 +6,11 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/moby/moby/api/types/container" - "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "github.com/spf13/cobra" ) -// APIClientProvider provides a method to get an [client.APIClient], initializing +// APIClientProvider provides a method to get a [client.APIClient], initializing // it if needed. // // It's a smaller interface than [command.Cli], and used in situations where an @@ -27,7 +26,7 @@ func ImageNames(dockerCLI APIClientProvider, limit int) cobra.CompletionFunc { if limit > 0 && len(args) >= limit { return nil, cobra.ShellCompDirectiveNoFileComp } - list, err := dockerCLI.Client().ImageList(cmd.Context(), image.ListOptions{}) + list, err := dockerCLI.Client().ImageList(cmd.Context(), client.ImageListOptions{}) if err != nil { return nil, cobra.ShellCompDirectiveError } diff --git a/cli/command/completion/functions_test.go b/cli/command/completion/functions_test.go index 29a8ecabc..ead28c617 100644 --- a/cli/command/completion/functions_test.go +++ b/cli/command/completion/functions_test.go @@ -31,7 +31,7 @@ func (c fakeCLI) Client() client.APIClient { type fakeClient struct { client.Client containerListFunc func(options container.ListOptions) ([]container.Summary, error) - imageListFunc func(options image.ListOptions) ([]image.Summary, error) + imageListFunc func(options client.ImageListOptions) ([]image.Summary, error) networkListFunc func(ctx context.Context, options client.NetworkListOptions) ([]network.Summary, error) volumeListFunc func(filter filters.Args) (volume.ListResponse, error) } @@ -43,7 +43,7 @@ func (c *fakeClient) ContainerList(_ context.Context, options container.ListOpti return []container.Summary{}, nil } -func (c *fakeClient) ImageList(_ context.Context, options image.ListOptions) ([]image.Summary, error) { +func (c *fakeClient) ImageList(_ context.Context, options client.ImageListOptions) ([]image.Summary, error) { if c.imageListFunc != nil { return c.imageListFunc(options) } @@ -228,7 +228,7 @@ func TestCompleteImageNames(t *testing.T) { for _, tc := range tests { t.Run(tc.doc, func(t *testing.T) { comp := ImageNames(fakeCLI{&fakeClient{ - imageListFunc: func(options image.ListOptions) ([]image.Summary, error) { + imageListFunc: func(options client.ImageListOptions) ([]image.Summary, error) { if tc.expDirective == cobra.ShellCompDirectiveError { return nil, errors.New("some error occurred") } diff --git a/cli/command/container/client_test.go b/cli/command/container/client_test.go index 7e6ede8ff..6dc16a4df 100644 --- a/cli/command/container/client_test.go +++ b/cli/command/container/client_test.go @@ -6,7 +6,6 @@ import ( "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/filters" - "github.com/moby/moby/api/types/image" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/system" "github.com/moby/moby/client" @@ -24,7 +23,7 @@ type fakeClient struct { platform *ocispec.Platform, containerName string) (container.CreateResponse, error) containerStartFunc func(containerID string, options container.StartOptions) error - imageCreateFunc func(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) + imageCreateFunc func(ctx context.Context, parentReference string, options client.ImageCreateOptions) (io.ReadCloser, error) infoFunc func() (system.Info, error) containerStatPathFunc func(containerID, path string) (container.PathStat, error) containerCopyFromFunc func(containerID, srcPath string) (io.ReadCloser, container.PathStat, error) @@ -99,7 +98,7 @@ func (f *fakeClient) ContainerRemove(ctx context.Context, containerID string, op return nil } -func (f *fakeClient) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { +func (f *fakeClient) ImageCreate(ctx context.Context, parentReference string, options client.ImageCreateOptions) (io.ReadCloser, error) { if f.imageCreateFunc != nil { return f.imageCreateFunc(ctx, parentReference, options) } diff --git a/cli/command/container/create.go b/cli/command/container/create.go index 190ccbad3..2e5361423 100644 --- a/cli/command/container/create.go +++ b/cli/command/container/create.go @@ -26,7 +26,6 @@ import ( "github.com/docker/cli/internal/jsonstream" "github.com/docker/cli/opts" "github.com/moby/moby/api/types/container" - imagetypes "github.com/moby/moby/api/types/image" "github.com/moby/moby/api/types/mount" "github.com/moby/moby/api/types/versions" "github.com/moby/moby/client" @@ -144,7 +143,7 @@ func pullImage(ctx context.Context, dockerCli command.Cli, img string, options * return err } - responseBody, err := dockerCli.Client().ImageCreate(ctx, img, imagetypes.CreateOptions{ + responseBody, err := dockerCli.Client().ImageCreate(ctx, img, client.ImageCreateOptions{ RegistryAuth: encodedAuth, Platform: options.platform, }) diff --git a/cli/command/container/create_test.go b/cli/command/container/create_test.go index 254b3d375..d3a08c79d 100644 --- a/cli/command/container/create_test.go +++ b/cli/command/container/create_test.go @@ -16,9 +16,9 @@ import ( "github.com/docker/cli/internal/test/notary" "github.com/google/go-cmp/cmp" "github.com/moby/moby/api/types/container" - "github.com/moby/moby/api/types/image" "github.com/moby/moby/api/types/network" "github.com/moby/moby/api/types/system" + "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/spf13/pflag" "gotest.tools/v3/assert" @@ -132,7 +132,7 @@ func TestCreateContainerImagePullPolicy(t *testing.T) { return container.CreateResponse{ID: containerID}, nil } }, - imageCreateFunc: func(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { + imageCreateFunc: func(ctx context.Context, parentReference string, options client.ImageCreateOptions) (io.ReadCloser, error) { defer func() { pullCounter++ }() return io.NopCloser(strings.NewReader("")), nil }, diff --git a/cli/command/container/run_test.go b/cli/command/container/run_test.go index b92d831fd..b17b8a8de 100644 --- a/cli/command/container/run_test.go +++ b/cli/command/container/run_test.go @@ -18,7 +18,6 @@ import ( "github.com/moby/moby/api/pkg/streamformatter" "github.com/moby/moby/api/types" "github.com/moby/moby/api/types/container" - "github.com/moby/moby/api/types/image" "github.com/moby/moby/api/types/network" "github.com/moby/moby/client" ocispec "github.com/opencontainers/image-spec/specs-go/v1" @@ -236,7 +235,7 @@ func TestRunPullTermination(t *testing.T) { containerAttachFunc: func(ctx context.Context, containerID string, options container.AttachOptions) (client.HijackedResponse, error) { return client.HijackedResponse{}, errors.New("shouldn't try to attach to a container") }, - imageCreateFunc: func(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { + imageCreateFunc: func(ctx context.Context, parentReference string, options client.ImageCreateOptions) (io.ReadCloser, error) { server, respReader := net.Pipe() t.Cleanup(func() { _ = server.Close() diff --git a/cli/command/image/client_test.go b/cli/command/image/client_test.go index be6c47687..a31c0acc7 100644 --- a/cli/command/image/client_test.go +++ b/cli/command/image/client_test.go @@ -17,15 +17,15 @@ type fakeClient struct { client.Client imageTagFunc func(string, string) error imageSaveFunc func(images []string, options ...client.ImageSaveOption) (io.ReadCloser, error) - imageRemoveFunc func(image string, options image.RemoveOptions) ([]image.DeleteResponse, error) - imagePushFunc func(ref string, options image.PushOptions) (io.ReadCloser, error) + imageRemoveFunc func(image string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) + imagePushFunc func(ref string, options client.ImagePushOptions) (io.ReadCloser, error) infoFunc func() (system.Info, error) - imagePullFunc func(ref string, options image.PullOptions) (io.ReadCloser, error) + imagePullFunc func(ref string, options client.ImagePullOptions) (io.ReadCloser, error) imagesPruneFunc func(pruneFilter filters.Args) (image.PruneReport, error) imageLoadFunc func(input io.Reader, options ...client.ImageLoadOption) (image.LoadResponse, error) - imageListFunc func(options image.ListOptions) ([]image.Summary, error) + imageListFunc func(options client.ImageListOptions) ([]image.Summary, error) imageInspectFunc func(img string) (image.InspectResponse, error) - imageImportFunc func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) + imageImportFunc func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) imageHistoryFunc func(img string, options ...client.ImageHistoryOption) ([]image.HistoryResponseItem, error) imageBuildFunc func(context.Context, io.Reader, build.ImageBuildOptions) (build.ImageBuildResponse, error) } @@ -45,7 +45,7 @@ func (cli *fakeClient) ImageSave(_ context.Context, images []string, options ... } func (cli *fakeClient) ImageRemove(_ context.Context, img string, - options image.RemoveOptions, + options client.ImageRemoveOptions, ) ([]image.DeleteResponse, error) { if cli.imageRemoveFunc != nil { return cli.imageRemoveFunc(img, options) @@ -53,7 +53,7 @@ func (cli *fakeClient) ImageRemove(_ context.Context, img string, return []image.DeleteResponse{}, nil } -func (cli *fakeClient) ImagePush(_ context.Context, ref string, options image.PushOptions) (io.ReadCloser, error) { +func (cli *fakeClient) ImagePush(_ context.Context, ref string, options client.ImagePushOptions) (io.ReadCloser, error) { if cli.imagePushFunc != nil { return cli.imagePushFunc(ref, options) } @@ -67,7 +67,7 @@ func (cli *fakeClient) Info(_ context.Context) (system.Info, error) { return system.Info{}, nil } -func (cli *fakeClient) ImagePull(_ context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) { +func (cli *fakeClient) ImagePull(_ context.Context, ref string, options client.ImagePullOptions) (io.ReadCloser, error) { if cli.imagePullFunc != nil { return cli.imagePullFunc(ref, options) } @@ -88,7 +88,7 @@ func (cli *fakeClient) ImageLoad(_ context.Context, input io.Reader, options ... return image.LoadResponse{}, nil } -func (cli *fakeClient) ImageList(_ context.Context, options image.ListOptions) ([]image.Summary, error) { +func (cli *fakeClient) ImageList(_ context.Context, options client.ImageListOptions) ([]image.Summary, error) { if cli.imageListFunc != nil { return cli.imageListFunc(options) } @@ -102,8 +102,8 @@ func (cli *fakeClient) ImageInspect(_ context.Context, img string, _ ...client.I return image.InspectResponse{}, nil } -func (cli *fakeClient) ImageImport(_ context.Context, source image.ImportSource, ref string, - options image.ImportOptions, +func (cli *fakeClient) ImageImport(_ context.Context, source client.ImageImportSource, ref string, + options client.ImageImportOptions, ) (io.ReadCloser, error) { if cli.imageImportFunc != nil { return cli.imageImportFunc(source, ref, options) diff --git a/cli/command/image/import.go b/cli/command/image/import.go index 27c1c789e..74bb7c60c 100644 --- a/cli/command/image/import.go +++ b/cli/command/image/import.go @@ -10,7 +10,7 @@ import ( "github.com/docker/cli/cli/command/completion" "github.com/docker/cli/internal/jsonstream" dockeropts "github.com/docker/cli/opts" - "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "github.com/spf13/cobra" ) @@ -54,17 +54,17 @@ func newImportCommand(dockerCLI command.Cli) *cobra.Command { } func runImport(ctx context.Context, dockerCli command.Cli, options importOptions) error { - var source image.ImportSource + var source client.ImageImportSource switch { case options.source == "-": // import from STDIN - source = image.ImportSource{ + source = client.ImageImportSource{ Source: dockerCli.In(), SourceName: options.source, } case strings.HasPrefix(options.source, "https://"), strings.HasPrefix(options.source, "http://"): // import from a remote source (handled by the daemon) - source = image.ImportSource{ + source = client.ImageImportSource{ SourceName: options.source, } default: @@ -74,13 +74,13 @@ func runImport(ctx context.Context, dockerCli command.Cli, options importOptions return err } defer file.Close() - source = image.ImportSource{ + source = client.ImageImportSource{ Source: file, SourceName: "-", } } - responseBody, err := dockerCli.Client().ImageImport(ctx, source, options.reference, image.ImportOptions{ + responseBody, err := dockerCli.Client().ImageImport(ctx, source, options.reference, client.ImageImportOptions{ Message: options.message, Changes: options.changes.GetSlice(), Platform: options.platform, diff --git a/cli/command/image/import_test.go b/cli/command/image/import_test.go index de7b6f3a2..c59c50aa3 100644 --- a/cli/command/image/import_test.go +++ b/cli/command/image/import_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/docker/cli/internal/test" - "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" ) @@ -17,7 +17,7 @@ func TestNewImportCommandErrors(t *testing.T) { name string args []string expectedError string - imageImportFunc func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) + imageImportFunc func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) }{ { name: "wrong-args", @@ -28,7 +28,7 @@ func TestNewImportCommandErrors(t *testing.T) { name: "import-failed", args: []string{"testdata/import-command-success.input.txt"}, expectedError: "something went wrong", - imageImportFunc: func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { + imageImportFunc: func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) { return nil, errors.New("something went wrong") }, }, @@ -54,7 +54,7 @@ func TestNewImportCommandSuccess(t *testing.T) { testCases := []struct { name string args []string - imageImportFunc func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) + imageImportFunc func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) }{ { name: "simple", @@ -67,7 +67,7 @@ func TestNewImportCommandSuccess(t *testing.T) { { name: "double", args: []string{"-", "image:local"}, - imageImportFunc: func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { + imageImportFunc: func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) { assert.Check(t, is.Equal("image:local", ref)) return io.NopCloser(strings.NewReader("")), nil }, @@ -75,7 +75,7 @@ func TestNewImportCommandSuccess(t *testing.T) { { name: "message", args: []string{"--message", "test message", "-"}, - imageImportFunc: func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { + imageImportFunc: func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) { assert.Check(t, is.Equal("test message", options.Message)) return io.NopCloser(strings.NewReader("")), nil }, @@ -83,7 +83,7 @@ func TestNewImportCommandSuccess(t *testing.T) { { name: "change", args: []string{"--change", "ENV DEBUG=true", "-"}, - imageImportFunc: func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { + imageImportFunc: func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) { assert.Check(t, is.Equal("ENV DEBUG=true", options.Changes[0])) return io.NopCloser(strings.NewReader("")), nil }, @@ -91,7 +91,7 @@ func TestNewImportCommandSuccess(t *testing.T) { { name: "change legacy syntax", args: []string{"--change", "ENV DEBUG true", "-"}, - imageImportFunc: func(source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { + imageImportFunc: func(source client.ImageImportSource, ref string, options client.ImageImportOptions) (io.ReadCloser, error) { assert.Check(t, is.Equal("ENV DEBUG true", options.Changes[0])) return io.NopCloser(strings.NewReader("")), nil }, diff --git a/cli/command/image/list.go b/cli/command/image/list.go index 6639efb55..5c8c6e181 100644 --- a/cli/command/image/list.go +++ b/cli/command/image/list.go @@ -12,6 +12,7 @@ import ( flagsHelper "github.com/docker/cli/cli/flags" "github.com/docker/cli/opts" "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "github.com/spf13/cobra" ) @@ -101,7 +102,7 @@ func runImages(ctx context.Context, dockerCLI command.Cli, options imagesOptions }) } - images, err := dockerCLI.Client().ImageList(ctx, image.ListOptions{ + images, err := dockerCLI.Client().ImageList(ctx, client.ImageListOptions{ All: options.all, Filters: filters, }) diff --git a/cli/command/image/list_test.go b/cli/command/image/list_test.go index 23cec46f8..b3e36b7c3 100644 --- a/cli/command/image/list_test.go +++ b/cli/command/image/list_test.go @@ -9,6 +9,7 @@ import ( "github.com/docker/cli/cli/config/configfile" "github.com/docker/cli/internal/test" "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -19,7 +20,7 @@ func TestNewImagesCommandErrors(t *testing.T) { name string args []string expectedError string - imageListFunc func(options image.ListOptions) ([]image.Summary, error) + imageListFunc func(options client.ImageListOptions) ([]image.Summary, error) }{ { name: "wrong-args", @@ -29,7 +30,7 @@ func TestNewImagesCommandErrors(t *testing.T) { { name: "failed-list", expectedError: "something went wrong", - imageListFunc: func(options image.ListOptions) ([]image.Summary, error) { + imageListFunc: func(options client.ImageListOptions) ([]image.Summary, error) { return []image.Summary{}, errors.New("something went wrong") }, }, @@ -50,7 +51,7 @@ func TestNewImagesCommandSuccess(t *testing.T) { name string args []string imageFormat string - imageListFunc func(options image.ListOptions) ([]image.Summary, error) + imageListFunc func(options client.ImageListOptions) ([]image.Summary, error) }{ { name: "simple", @@ -67,7 +68,7 @@ func TestNewImagesCommandSuccess(t *testing.T) { { name: "match-name", args: []string{"image"}, - imageListFunc: func(options image.ListOptions) ([]image.Summary, error) { + imageListFunc: func(options client.ImageListOptions) ([]image.Summary, error) { assert.Check(t, is.Equal("image", options.Filters.Get("reference")[0])) return []image.Summary{}, nil }, @@ -75,7 +76,7 @@ func TestNewImagesCommandSuccess(t *testing.T) { { name: "filters", args: []string{"--filter", "name=value"}, - imageListFunc: func(options image.ListOptions) ([]image.Summary, error) { + imageListFunc: func(options client.ImageListOptions) ([]image.Summary, error) { assert.Check(t, is.Equal("value", options.Filters.Get("name")[0])) return []image.Summary{}, nil }, diff --git a/cli/command/image/pull_test.go b/cli/command/image/pull_test.go index fda5f8199..6d111993e 100644 --- a/cli/command/image/pull_test.go +++ b/cli/command/image/pull_test.go @@ -9,7 +9,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/cli/internal/test/notary" - "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -74,7 +74,7 @@ func TestNewPullCommandSuccess(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - imagePullFunc: func(ref string, options image.PullOptions) (io.ReadCloser, error) { + imagePullFunc: func(ref string, options client.ImagePullOptions) (io.ReadCloser, error) { assert.Check(t, is.Equal(tc.expectedTag, ref), tc.name) return io.NopCloser(strings.NewReader("")), nil }, @@ -119,7 +119,7 @@ func TestNewPullCommandWithContentTrustErrors(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - imagePullFunc: func(ref string, options image.PullOptions) (io.ReadCloser, error) { + imagePullFunc: func(ref string, options client.ImagePullOptions) (io.ReadCloser, error) { return io.NopCloser(strings.NewReader("")), errors.New("shouldn't try to pull image") }, }, test.EnableContentTrust) diff --git a/cli/command/image/push.go b/cli/command/image/push.go index 5c3da6c72..e7475cbab 100644 --- a/cli/command/image/push.go +++ b/cli/command/image/push.go @@ -20,7 +20,7 @@ import ( "github.com/docker/cli/internal/tui" "github.com/moby/moby/api/pkg/authconfig" "github.com/moby/moby/api/types/auxprogress" - "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "github.com/morikuni/aec" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -116,7 +116,7 @@ To push the complete multi-platform image, remove the --platform flag. return err } - responseBody, err := dockerCli.Client().ImagePush(ctx, reference.FamiliarString(ref), image.PushOptions{ + responseBody, err := dockerCli.Client().ImagePush(ctx, reference.FamiliarString(ref), client.ImagePushOptions{ All: opts.all, RegistryAuth: encodedAuth, PrivilegeFunc: nil, diff --git a/cli/command/image/push_test.go b/cli/command/image/push_test.go index 587da41d7..14ad5817c 100644 --- a/cli/command/image/push_test.go +++ b/cli/command/image/push_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/docker/cli/internal/test" - "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "gotest.tools/v3/assert" ) @@ -16,7 +16,7 @@ func TestNewPushCommandErrors(t *testing.T) { name string args []string expectedError string - imagePushFunc func(ref string, options image.PushOptions) (io.ReadCloser, error) + imagePushFunc func(ref string, options client.ImagePushOptions) (io.ReadCloser, error) }{ { name: "wrong-args", @@ -32,7 +32,7 @@ func TestNewPushCommandErrors(t *testing.T) { name: "push-failed", args: []string{"image:repo"}, expectedError: "Failed to push", - imagePushFunc: func(ref string, options image.PushOptions) (io.ReadCloser, error) { + imagePushFunc: func(ref string, options client.ImagePushOptions) (io.ReadCloser, error) { return io.NopCloser(strings.NewReader("")), errors.New("Failed to push") }, }, @@ -69,7 +69,7 @@ func TestNewPushCommandSuccess(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - imagePushFunc: func(ref string, options image.PushOptions) (io.ReadCloser, error) { + imagePushFunc: func(ref string, options client.ImagePushOptions) (io.ReadCloser, error) { return io.NopCloser(strings.NewReader("")), nil }, }) diff --git a/cli/command/image/remove.go b/cli/command/image/remove.go index 108229d1f..61a2cdfa2 100644 --- a/cli/command/image/remove.go +++ b/cli/command/image/remove.go @@ -10,7 +10,7 @@ import ( "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command/completion" - "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "github.com/spf13/cobra" ) @@ -61,7 +61,7 @@ func newImageRemoveCommand(dockerCli command.Cli) *cobra.Command { func runRemove(ctx context.Context, dockerCLI command.Cli, opts removeOptions, images []string) error { apiClient := dockerCLI.Client() - options := image.RemoveOptions{ + options := client.ImageRemoveOptions{ Force: opts.force, PruneChildren: !opts.noPrune, } diff --git a/cli/command/image/remove_test.go b/cli/command/image/remove_test.go index 6db34cd6e..402ccc7cc 100644 --- a/cli/command/image/remove_test.go +++ b/cli/command/image/remove_test.go @@ -8,6 +8,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -35,7 +36,7 @@ func TestNewRemoveCommandErrors(t *testing.T) { name string args []string expectedError string - imageRemoveFunc func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) + imageRemoveFunc func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) }{ { name: "wrong args", @@ -45,7 +46,7 @@ func TestNewRemoveCommandErrors(t *testing.T) { name: "ImageRemove fail with force option", args: []string{"-f", "image1"}, expectedError: "error removing image", - imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + imageRemoveFunc: func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) { assert.Check(t, is.Equal("image1", img)) return []image.DeleteResponse{}, errors.New("error removing image") }, @@ -54,7 +55,7 @@ func TestNewRemoveCommandErrors(t *testing.T) { name: "ImageRemove fail", args: []string{"arg1"}, expectedError: "error removing image", - imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + imageRemoveFunc: func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) { assert.Check(t, !options.Force) assert.Check(t, options.PruneChildren) return []image.DeleteResponse{}, errors.New("error removing image") @@ -78,13 +79,13 @@ func TestNewRemoveCommandSuccess(t *testing.T) { testCases := []struct { name string args []string - imageRemoveFunc func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) + imageRemoveFunc func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) expectedStderr string }{ { name: "Image Deleted", args: []string{"image1"}, - imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + imageRemoveFunc: func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) { assert.Check(t, is.Equal("image1", img)) return []image.DeleteResponse{{Deleted: img}}, nil }, @@ -92,7 +93,7 @@ func TestNewRemoveCommandSuccess(t *testing.T) { { name: "Image not found with force option", args: []string{"-f", "image1"}, - imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + imageRemoveFunc: func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) { assert.Check(t, is.Equal("image1", img)) assert.Check(t, is.Equal(true, options.Force)) return []image.DeleteResponse{}, notFound{"image1"} @@ -103,7 +104,7 @@ func TestNewRemoveCommandSuccess(t *testing.T) { { name: "Image Untagged", args: []string{"image1"}, - imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + imageRemoveFunc: func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) { assert.Check(t, is.Equal("image1", img)) return []image.DeleteResponse{{Untagged: img}}, nil }, @@ -111,7 +112,7 @@ func TestNewRemoveCommandSuccess(t *testing.T) { { name: "Image Deleted and Untagged", args: []string{"image1", "image2"}, - imageRemoveFunc: func(img string, options image.RemoveOptions) ([]image.DeleteResponse, error) { + imageRemoveFunc: func(img string, options client.ImageRemoveOptions) ([]image.DeleteResponse, error) { if img == "image1" { return []image.DeleteResponse{{Untagged: img}}, nil } diff --git a/cli/command/image/tree.go b/cli/command/image/tree.go index 8fc2f52b3..caee86b3a 100644 --- a/cli/command/image/tree.go +++ b/cli/command/image/tree.go @@ -19,6 +19,7 @@ import ( "github.com/docker/go-units" "github.com/moby/moby/api/types/filters" imagetypes "github.com/moby/moby/api/types/image" + "github.com/moby/moby/client" "github.com/morikuni/aec" "github.com/opencontainers/go-digest" ) @@ -36,7 +37,7 @@ type treeView struct { } func runTree(ctx context.Context, dockerCLI command.Cli, opts treeOptions) error { - images, err := dockerCLI.Client().ImageList(ctx, imagetypes.ListOptions{ + images, err := dockerCLI.Client().ImageList(ctx, client.ImageListOptions{ All: opts.all, Filters: opts.filters, Manifests: true, diff --git a/cli/command/image/trust.go b/cli/command/image/trust.go index c751a8a6c..d613486f7 100644 --- a/cli/command/image/trust.go +++ b/cli/command/image/trust.go @@ -13,12 +13,12 @@ import ( "github.com/docker/cli/cli/trust" "github.com/docker/cli/internal/jsonstream" "github.com/moby/moby/api/pkg/authconfig" - "github.com/moby/moby/api/types/image" registrytypes "github.com/moby/moby/api/types/registry" + "github.com/moby/moby/client" "github.com/opencontainers/go-digest" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "github.com/theupdateframework/notary/client" + notaryclient "github.com/theupdateframework/notary/client" "github.com/theupdateframework/notary/tuf/data" ) @@ -30,11 +30,11 @@ type target struct { // notaryClientProvider is used in tests to provide a dummy notary client. type notaryClientProvider interface { - NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error) + NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error) } // newNotaryClient provides a Notary Repository to interact with signed metadata for an image. -func newNotaryClient(cli command.Streams, imgRefAndAuth trust.ImageRefAndAuth) (client.Repository, error) { +func newNotaryClient(cli command.Streams, imgRefAndAuth trust.ImageRefAndAuth) (notaryclient.Repository, error) { if ncp, ok := cli.(notaryClientProvider); ok { // notaryClientProvider is used in tests to provide a dummy notary client. return ncp.NotaryClient(imgRefAndAuth, []string{"pull"}) @@ -154,7 +154,7 @@ func imagePullPrivileged(ctx context.Context, cli command.Cli, imgRefAndAuth tru if err != nil { return err } - responseBody, err := cli.Client().ImagePull(ctx, reference.FamiliarString(imgRefAndAuth.Reference()), image.PullOptions{ + responseBody, err := cli.Client().ImagePull(ctx, reference.FamiliarString(imgRefAndAuth.Reference()), client.ImagePullOptions{ RegistryAuth: encodedAuth, PrivilegeFunc: nil, All: opts.all, @@ -191,7 +191,7 @@ func TrustedReference(ctx context.Context, cli command.Cli, ref reference.NamedT // Only list tags in the top level targets role or the releases delegation role - ignore // all other delegation roles if t.Role != trust.ReleasesRole && t.Role != data.CanonicalTargetsRole { - return nil, trust.NotaryError(imgRefAndAuth.RepoInfo().Name.Name(), client.ErrNoSuchTarget(ref.Tag())) + return nil, trust.NotaryError(imgRefAndAuth.RepoInfo().Name.Name(), notaryclient.ErrNoSuchTarget(ref.Tag())) } r, err := convertTarget(t.Target) if err != nil { @@ -200,7 +200,7 @@ func TrustedReference(ctx context.Context, cli command.Cli, ref reference.NamedT return reference.WithDigest(reference.TrimNamed(ref), r.digest) } -func convertTarget(t client.Target) (target, error) { +func convertTarget(t notaryclient.Target) (target, error) { h, ok := t.Hashes["sha256"] if !ok { return target{}, errors.New("no valid hash, expecting sha256") diff --git a/cli/command/secret/client_test.go b/cli/command/secret/client_test.go index 25a80450a..1ad7f0da9 100644 --- a/cli/command/secret/client_test.go +++ b/cli/command/secret/client_test.go @@ -11,7 +11,7 @@ type fakeClient struct { client.Client secretCreateFunc func(context.Context, swarm.SecretSpec) (swarm.SecretCreateResponse, error) secretInspectFunc func(context.Context, string) (swarm.Secret, []byte, error) - secretListFunc func(context.Context, swarm.SecretListOptions) ([]swarm.Secret, error) + secretListFunc func(context.Context, client.SecretListOptions) ([]swarm.Secret, error) secretRemoveFunc func(context.Context, string) error } @@ -29,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 swarm.SecretListOptions) ([]swarm.Secret, error) { +func (c *fakeClient) SecretList(ctx context.Context, options client.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 6bf4050ff..12abe6b45 100644 --- a/cli/command/secret/cmd.go +++ b/cli/command/secret/cmd.go @@ -5,7 +5,7 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command/completion" "github.com/docker/cli/internal/commands" - "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/client" "github.com/spf13/cobra" ) @@ -37,7 +37,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(), swarm.SecretListOptions{}) + list, err := dockerCLI.Client().SecretList(cmd.Context(), client.SecretListOptions{}) if err != nil { return nil, cobra.ShellCompDirectiveError } diff --git a/cli/command/secret/ls.go b/cli/command/secret/ls.go index 565c1cf7f..b30106f67 100644 --- a/cli/command/secret/ls.go +++ b/cli/command/secret/ls.go @@ -10,7 +10,7 @@ import ( flagsHelper "github.com/docker/cli/cli/flags" "github.com/docker/cli/opts" "github.com/fvbommel/sortorder" - "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/client" "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 { apiClient := dockerCLI.Client() - secrets, err := apiClient.SecretList(ctx, swarm.SecretListOptions{Filters: options.filter.Value()}) + secrets, err := apiClient.SecretList(ctx, client.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 3f60a9ce0..8f98d22db 100644 --- a/cli/command/secret/ls_test.go +++ b/cli/command/secret/ls_test.go @@ -11,6 +11,7 @@ import ( "github.com/docker/cli/internal/test" "github.com/docker/cli/internal/test/builders" "github.com/moby/moby/api/types/swarm" + "github.com/moby/moby/client" "gotest.tools/v3/assert" is "gotest.tools/v3/assert/cmp" "gotest.tools/v3/golden" @@ -19,7 +20,7 @@ import ( func TestSecretListErrors(t *testing.T) { testCases := []struct { args []string - secretListFunc func(context.Context, swarm.SecretListOptions) ([]swarm.Secret, error) + secretListFunc func(context.Context, client.SecretListOptions) ([]swarm.Secret, error) expectedError string }{ { @@ -27,7 +28,7 @@ func TestSecretListErrors(t *testing.T) { expectedError: "accepts no argument", }, { - secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options client.SecretListOptions) ([]swarm.Secret, error) { return []swarm.Secret{}, errors.New("error listing secrets") }, expectedError: "error listing secrets", @@ -48,7 +49,7 @@ func TestSecretListErrors(t *testing.T) { func TestSecretList(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options client.SecretListOptions) ([]swarm.Secret, error) { return []swarm.Secret{ *builders.Secret(builders.SecretID("ID-1-foo"), builders.SecretName("1-foo"), @@ -80,7 +81,7 @@ func TestSecretList(t *testing.T) { func TestSecretListWithQuietOption(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options client.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{ @@ -97,7 +98,7 @@ func TestSecretListWithQuietOption(t *testing.T) { func TestSecretListWithConfigFormat(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options client.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{ @@ -116,7 +117,7 @@ func TestSecretListWithConfigFormat(t *testing.T) { func TestSecretListWithFormat(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options client.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{ @@ -133,7 +134,7 @@ func TestSecretListWithFormat(t *testing.T) { func TestSecretListWithFilter(t *testing.T) { cli := test.NewFakeCli(&fakeClient{ - secretListFunc: func(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(_ context.Context, options client.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/parse.go b/cli/command/service/parse.go index 5ade15e59..38c8e8267 100644 --- a/cli/command/service/parse.go +++ b/cli/command/service/parse.go @@ -32,7 +32,7 @@ func ParseSecrets(ctx context.Context, apiClient client.SecretAPIClient, request args.Add("name", s.SecretName) } - secrets, err := apiClient.SecretList(ctx, swarm.SecretListOptions{ + secrets, err := apiClient.SecretList(ctx, client.SecretListOptions{ Filters: args, }) if err != nil { diff --git a/cli/command/service/update_test.go b/cli/command/service/update_test.go index 41924de18..b786f2c8c 100644 --- a/cli/command/service/update_test.go +++ b/cli/command/service/update_test.go @@ -504,7 +504,7 @@ type secretAPIClientMock struct { listResult []swarm.Secret } -func (s secretAPIClientMock) SecretList(context.Context, swarm.SecretListOptions) ([]swarm.Secret, error) { +func (s secretAPIClientMock) SecretList(context.Context, client.SecretListOptions) ([]swarm.Secret, error) { return s.listResult, nil } diff --git a/cli/command/stack/client_test.go b/cli/command/stack/client_test.go index c2b3cbf02..27cae8bb4 100644 --- a/cli/command/stack/client_test.go +++ b/cli/command/stack/client_test.go @@ -29,7 +29,7 @@ type fakeClient struct { serviceListFunc func(options client.ServiceListOptions) ([]swarm.Service, error) networkListFunc func(options client.NetworkListOptions) ([]network.Summary, error) - secretListFunc func(options swarm.SecretListOptions) ([]swarm.Secret, error) + secretListFunc func(options client.SecretListOptions) ([]swarm.Secret, error) configListFunc func(options client.ConfigListOptions) ([]swarm.Config, error) nodeListFunc func(options client.NodeListOptions) ([]swarm.Node, error) taskListFunc func(options client.TaskListOptions) ([]swarm.Task, error) @@ -84,7 +84,7 @@ func (cli *fakeClient) NetworkList(_ context.Context, options client.NetworkList return networksList, nil } -func (cli *fakeClient) SecretList(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { +func (cli *fakeClient) SecretList(_ context.Context, options client.SecretListOptions) ([]swarm.Secret, error) { if cli.secretListFunc != nil { return cli.secretListFunc(options) } diff --git a/cli/command/stack/swarm/client_test.go b/cli/command/stack/swarm/client_test.go index 65e37b0c7..400598f06 100644 --- a/cli/command/stack/swarm/client_test.go +++ b/cli/command/stack/swarm/client_test.go @@ -29,7 +29,7 @@ type fakeClient struct { serviceListFunc func(options client.ServiceListOptions) ([]swarm.Service, error) networkListFunc func(options client.NetworkListOptions) ([]network.Summary, error) - secretListFunc func(options swarm.SecretListOptions) ([]swarm.Secret, error) + secretListFunc func(options client.SecretListOptions) ([]swarm.Secret, error) configListFunc func(options client.ConfigListOptions) ([]swarm.Config, error) nodeListFunc func(options client.NodeListOptions) ([]swarm.Node, error) taskListFunc func(options client.TaskListOptions) ([]swarm.Task, error) @@ -84,7 +84,7 @@ func (cli *fakeClient) NetworkList(_ context.Context, options client.NetworkList return networksList, nil } -func (cli *fakeClient) SecretList(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { +func (cli *fakeClient) SecretList(_ context.Context, options client.SecretListOptions) ([]swarm.Secret, error) { if cli.secretListFunc != nil { return cli.secretListFunc(options) } diff --git a/cli/command/stack/swarm/common.go b/cli/command/stack/swarm/common.go index b5bd9568e..3b195ad95 100644 --- a/cli/command/stack/swarm/common.go +++ b/cli/command/stack/swarm/common.go @@ -38,7 +38,7 @@ 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, swarm.SecretListOptions{Filters: getStackFilter(namespace)}) + return apiclient.SecretList(ctx, client.SecretListOptions{Filters: getStackFilter(namespace)}) } func getStackConfigs(ctx context.Context, apiclient client.APIClient, namespace string) ([]swarm.Config, error) { diff --git a/cli/command/system/client_test.go b/cli/command/system/client_test.go index 3a24e6464..994206ae7 100644 --- a/cli/command/system/client_test.go +++ b/cli/command/system/client_test.go @@ -22,7 +22,7 @@ type fakeClient struct { containerListFunc func(context.Context, container.ListOptions) ([]container.Summary, error) containerPruneFunc func(ctx context.Context, pruneFilters filters.Args) (container.PruneReport, error) eventsFn func(context.Context, client.EventsListOptions) (<-chan events.Message, <-chan error) - imageListFunc func(ctx context.Context, options image.ListOptions) ([]image.Summary, error) + imageListFunc func(ctx context.Context, options client.ImageListOptions) ([]image.Summary, error) infoFunc func(ctx context.Context) (system.Info, error) networkListFunc func(ctx context.Context, options client.NetworkListOptions) ([]network.Summary, error) networkPruneFunc func(ctx context.Context, pruneFilter filters.Args) (network.PruneReport, error) @@ -53,7 +53,7 @@ func (cli *fakeClient) Events(ctx context.Context, opts client.EventsListOptions return cli.eventsFn(ctx, opts) } -func (cli *fakeClient) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) { +func (cli *fakeClient) ImageList(ctx context.Context, options client.ImageListOptions) ([]image.Summary, error) { if cli.imageListFunc != nil { return cli.imageListFunc(ctx, options) } diff --git a/cli/command/system/completion.go b/cli/command/system/completion.go index 3e0f493be..8b3c1fc5b 100644 --- a/cli/command/system/completion.go +++ b/cli/command/system/completion.go @@ -5,7 +5,6 @@ import ( "github.com/docker/cli/cli/command/completion" "github.com/moby/moby/api/types/events" - "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "github.com/spf13/cobra" ) @@ -181,7 +180,7 @@ func daemonNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []s // imageNames contacts the API to get a list of image names. // In case of an error, an empty list is returned. func imageNames(dockerCLI completion.APIClientProvider, cmd *cobra.Command) []string { - list, err := dockerCLI.Client().ImageList(cmd.Context(), image.ListOptions{}) + list, err := dockerCLI.Client().ImageList(cmd.Context(), client.ImageListOptions{}) if err != nil { return []string{} } diff --git a/cli/command/system/completion_test.go b/cli/command/system/completion_test.go index d7d251d15..b85f38c37 100644 --- a/cli/command/system/completion_test.go +++ b/cli/command/system/completion_test.go @@ -69,7 +69,7 @@ func TestCompleteEventFilter(t *testing.T) { }, { client: &fakeClient{ - imageListFunc: func(_ context.Context, _ image.ListOptions) ([]image.Summary, error) { + imageListFunc: func(_ context.Context, _ client.ImageListOptions) ([]image.Summary, error) { return []image.Summary{ {RepoTags: []string{"img:1"}}, {RepoTags: []string{"img:2"}}, @@ -81,7 +81,7 @@ func TestCompleteEventFilter(t *testing.T) { }, { client: &fakeClient{ - imageListFunc: func(_ context.Context, _ image.ListOptions) ([]image.Summary, error) { + imageListFunc: func(_ context.Context, _ client.ImageListOptions) ([]image.Summary, error) { return []image.Summary{}, errors.New("API error") }, }, diff --git a/cli/command/trust/inspect_pretty_test.go b/cli/command/trust/inspect_pretty_test.go index b2d01e5ad..963818297 100644 --- a/cli/command/trust/inspect_pretty_test.go +++ b/cli/command/trust/inspect_pretty_test.go @@ -36,7 +36,7 @@ func (*fakeClient) ImageInspect(context.Context, string, ...client.ImageInspectO return image.InspectResponse{}, nil } -func (*fakeClient) ImagePush(context.Context, string, image.PushOptions) (io.ReadCloser, error) { +func (*fakeClient) ImagePush(context.Context, string, client.ImagePushOptions) (io.ReadCloser, error) { return &utils.NoopCloser{Reader: bytes.NewBuffer([]byte{})}, nil } diff --git a/cli/command/trust/sign.go b/cli/command/trust/sign.go index c77cb12b0..36b65a192 100644 --- a/cli/command/trust/sign.go +++ b/cli/command/trust/sign.go @@ -14,7 +14,6 @@ import ( "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/trust" "github.com/moby/moby/api/pkg/authconfig" - imagetypes "github.com/moby/moby/api/types/image" "github.com/moby/moby/client" "github.com/spf13/cobra" notaryclient "github.com/theupdateframework/notary/client" @@ -97,7 +96,7 @@ func runSignImage(ctx context.Context, dockerCLI command.Cli, options signOption if err != nil { return err } - responseBody, err := dockerCLI.Client().ImagePush(ctx, reference.FamiliarString(imgRefAndAuth.Reference()), imagetypes.PushOptions{ + responseBody, err := dockerCLI.Client().ImagePush(ctx, reference.FamiliarString(imgRefAndAuth.Reference()), client.ImagePushOptions{ RegistryAuth: encodedAuth, PrivilegeFunc: nil, }) diff --git a/cli/compose/convert/service_test.go b/cli/compose/convert/service_test.go index 6c03f79be..82db56157 100644 --- a/cli/compose/convert/service_test.go +++ b/cli/compose/convert/service_test.go @@ -513,7 +513,7 @@ func TestConvertServiceSecrets(t *testing.T) { }, } apiClient := &fakeClient{ - secretListFunc: func(opts swarm.SecretListOptions) ([]swarm.Secret, error) { + secretListFunc: func(opts client.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{ @@ -614,11 +614,11 @@ func TestConvertServiceConfigs(t *testing.T) { type fakeClient struct { client.Client - secretListFunc func(swarm.SecretListOptions) ([]swarm.Secret, error) + secretListFunc func(client.SecretListOptions) ([]swarm.Secret, error) configListFunc func(client.ConfigListOptions) ([]swarm.Config, error) } -func (c *fakeClient) SecretList(_ context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { +func (c *fakeClient) SecretList(_ context.Context, options client.SecretListOptions) ([]swarm.Secret, error) { if c.secretListFunc != nil { return c.secretListFunc(options) } diff --git a/vendor.mod b/vendor.mod index 9bcc1b273..43858a2f9 100644 --- a/vendor.mod +++ b/vendor.mod @@ -28,8 +28,8 @@ require ( github.com/google/uuid v1.6.0 github.com/mattn/go-runewidth v0.0.16 github.com/moby/go-archive v0.1.0 - github.com/moby/moby/api v1.52.0-alpha.1.0.20250826164402-7145e7666b8f // master - github.com/moby/moby/client v0.1.0-alpha.0.0.20250826164402-7145e7666b8f // master + github.com/moby/moby/api v1.52.0-alpha.1.0.20250826224528-62884141100c // master + github.com/moby/moby/client v0.1.0-alpha.0.0.20250826224528-62884141100c // master github.com/moby/patternmatcher v0.6.0 github.com/moby/swarmkit/v2 v2.0.0 github.com/moby/sys/atomicwriter v0.1.0 diff --git a/vendor.sum b/vendor.sum index 9b204acaf..620217855 100644 --- a/vendor.sum +++ b/vendor.sum @@ -170,10 +170,10 @@ github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3N github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo= -github.com/moby/moby/api v1.52.0-alpha.1.0.20250826164402-7145e7666b8f h1:faKJR1203hI97HWd0Y4cNBEKLy4nWdkjYpqP4D+j+nk= -github.com/moby/moby/api v1.52.0-alpha.1.0.20250826164402-7145e7666b8f/go.mod h1:8sBV0soUREiudtow4vqJGOxa4GyHI5vLQmvgKdHq5Ok= -github.com/moby/moby/client v0.1.0-alpha.0.0.20250826164402-7145e7666b8f h1:AoyUekdtDsiajk9W2+n0zWR+926oRcuy9AHZSX0whJw= -github.com/moby/moby/client v0.1.0-alpha.0.0.20250826164402-7145e7666b8f/go.mod h1:7pOYrEHdG7I0dNZEC+yqk/p8ZOxGMR1KgoexzCEDe0w= +github.com/moby/moby/api v1.52.0-alpha.1.0.20250826224528-62884141100c h1:AcG4SepExP6gSs565xPaCqlmEq0uDHKE1rYvnvVPCKk= +github.com/moby/moby/api v1.52.0-alpha.1.0.20250826224528-62884141100c/go.mod h1:8sBV0soUREiudtow4vqJGOxa4GyHI5vLQmvgKdHq5Ok= +github.com/moby/moby/client v0.1.0-alpha.0.0.20250826224528-62884141100c h1:+O0DPAuYz+gqyPLChsGdFUIR2ujMlyJcTchS5PDdrYU= +github.com/moby/moby/client v0.1.0-alpha.0.0.20250826224528-62884141100c/go.mod h1:7pOYrEHdG7I0dNZEC+yqk/p8ZOxGMR1KgoexzCEDe0w= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/swarmkit/v2 v2.0.0 h1:jkWQKQaJ4ltA61/mC9UdPe1McLma55RUcacTO+pPweY= diff --git a/vendor/github.com/moby/moby/api/types/image/opts.go b/vendor/github.com/moby/moby/api/types/image/opts.go deleted file mode 100644 index 789037a59..000000000 --- a/vendor/github.com/moby/moby/api/types/image/opts.go +++ /dev/null @@ -1,124 +0,0 @@ -package image - -import ( - "context" - "io" - - "github.com/moby/moby/api/types/filters" - ocispec "github.com/opencontainers/image-spec/specs-go/v1" -) - -// ImportSource holds source information for ImageImport -type ImportSource struct { - Source io.Reader // Source is the data to send to the server to create this image from. You must set SourceName to "-" to leverage this. - SourceName string // SourceName is the name of the image to pull. Set to "-" to leverage the Source attribute. -} - -// ImportOptions holds information to import images from the client host. -type ImportOptions struct { - Tag string // Tag is the name to tag this image with. This attribute is deprecated. - Message string // Message is the message to tag the image with - Changes []string // Changes are the raw changes to apply to this image - Platform string // Platform is the target platform of the image -} - -// CreateOptions holds information to create images. -type CreateOptions struct { - RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry. - Platform string // Platform is the target platform of the image if it needs to be pulled from the registry. -} - -// PullOptions holds information to pull images. -type PullOptions struct { - All bool - RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry - - // PrivilegeFunc is a function that clients can supply to retry operations - // after getting an authorization error. This function returns the registry - // authentication header value in base64 encoded format, or an error if the - // privilege request fails. - // - // For details, refer to [github.com/moby/moby/api/types/registry.RequestAuthConfig]. - PrivilegeFunc func(context.Context) (string, error) - Platform string -} - -// PushOptions holds information to push images. -type PushOptions struct { - All bool - RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry - - // PrivilegeFunc is a function that clients can supply to retry operations - // after getting an authorization error. This function returns the registry - // authentication header value in base64 encoded format, or an error if the - // privilege request fails. - // - // For details, refer to [github.com/moby/moby/api/types/registry.RequestAuthConfig]. - PrivilegeFunc func(context.Context) (string, error) - - // Platform is an optional field that selects a specific platform to push - // when the image is a multi-platform image. - // Using this will only push a single platform-specific manifest. - Platform *ocispec.Platform `json:",omitempty"` -} - -// ListOptions holds parameters to list images with. -type ListOptions struct { - // All controls whether all images in the graph are filtered, or just - // the heads. - All bool - - // Filters is a JSON-encoded set of filter arguments. - Filters filters.Args - - // SharedSize indicates whether the shared size of images should be computed. - SharedSize bool - - // ContainerCount indicates whether container count should be computed. - // - // Deprecated: This field has been unused and is no longer required and will be removed in a future version. - ContainerCount bool - - // Manifests indicates whether the image manifests should be returned. - Manifests bool -} - -// RemoveOptions holds parameters to remove images. -type RemoveOptions struct { - Platforms []ocispec.Platform - Force bool - PruneChildren bool -} - -// HistoryOptions holds parameters to get image history. -type HistoryOptions struct { - // Platform from the manifest list to use for history. - Platform *ocispec.Platform -} - -// LoadOptions holds parameters to load images. -type LoadOptions struct { - // Quiet suppresses progress output - Quiet bool - - // Platforms selects the platforms to load if the image is a - // multi-platform image and has multiple variants. - Platforms []ocispec.Platform -} - -type InspectOptions struct { - // Manifests returns the image manifests. - Manifests bool - - // Platform selects the specific platform of a multi-platform image to inspect. - // - // This option is only available for API version 1.49 and up. - Platform *ocispec.Platform -} - -// SaveOptions holds parameters to save images. -type SaveOptions struct { - // Platforms selects the platforms to save if the image is a - // multi-platform image and has multiple variants. - Platforms []ocispec.Platform -} diff --git a/vendor/github.com/moby/moby/api/types/swarm/secret.go b/vendor/github.com/moby/moby/api/types/swarm/secret.go index 6fea600b4..0e27ed9b0 100644 --- a/vendor/github.com/moby/moby/api/types/swarm/secret.go +++ b/vendor/github.com/moby/moby/api/types/swarm/secret.go @@ -2,8 +2,6 @@ package swarm import ( "os" - - "github.com/moby/moby/api/types/filters" ) // Secret represents a secret. @@ -59,8 +57,3 @@ 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/moby/moby/client/client_interfaces.go b/vendor/github.com/moby/moby/client/client_interfaces.go index c686f535f..1b597a12c 100644 --- a/vendor/github.com/moby/moby/client/client_interfaces.go +++ b/vendor/github.com/moby/moby/client/client_interfaces.go @@ -109,13 +109,13 @@ type ImageAPIClient interface { 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) - ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) + ImageCreate(ctx context.Context, parentReference string, options ImageCreateOptions) (io.ReadCloser, error) + ImageImport(ctx context.Context, source ImageImportSource, ref string, options ImageImportOptions) (io.ReadCloser, error) - ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) - ImagePull(ctx context.Context, ref string, options image.PullOptions) (io.ReadCloser, error) - ImagePush(ctx context.Context, ref string, options image.PushOptions) (io.ReadCloser, error) - ImageRemove(ctx context.Context, image string, options image.RemoveOptions) ([]image.DeleteResponse, error) + ImageList(ctx context.Context, options ImageListOptions) ([]image.Summary, error) + ImagePull(ctx context.Context, ref string, options ImagePullOptions) (io.ReadCloser, error) + ImagePush(ctx context.Context, ref string, options ImagePushOptions) (io.ReadCloser, error) + ImageRemove(ctx context.Context, image string, options ImageRemoveOptions) ([]image.DeleteResponse, error) ImageSearch(ctx context.Context, term string, options ImageSearchOptions) ([]registry.SearchResult, error) ImageTag(ctx context.Context, image, ref string) error ImagesPrune(ctx context.Context, pruneFilter filters.Args) (image.PruneReport, error) @@ -206,7 +206,7 @@ type VolumeAPIClient interface { // SecretAPIClient defines API client methods for secrets type SecretAPIClient interface { - SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) + SecretList(ctx context.Context, options 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) diff --git a/vendor/github.com/moby/moby/client/image_create.go b/vendor/github.com/moby/moby/client/image_create.go index 4282158d2..12bd38f3d 100644 --- a/vendor/github.com/moby/moby/client/image_create.go +++ b/vendor/github.com/moby/moby/client/image_create.go @@ -8,13 +8,12 @@ import ( "strings" "github.com/distribution/reference" - "github.com/moby/moby/api/types/image" "github.com/moby/moby/api/types/registry" ) // ImageCreate creates a new image based on the parent options. // It returns the JSON content in the response body. -func (cli *Client) ImageCreate(ctx context.Context, parentReference string, options image.CreateOptions) (io.ReadCloser, error) { +func (cli *Client) ImageCreate(ctx context.Context, parentReference string, options ImageCreateOptions) (io.ReadCloser, error) { ref, err := reference.ParseNormalizedNamed(parentReference) if err != nil { return nil, err diff --git a/vendor/github.com/moby/moby/client/image_create_opts.go b/vendor/github.com/moby/moby/client/image_create_opts.go new file mode 100644 index 000000000..a55f35d4d --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_create_opts.go @@ -0,0 +1,7 @@ +package client + +// ImageCreateOptions holds information to create images. +type ImageCreateOptions struct { + RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry. + Platform string // Platform is the target platform of the image if it needs to be pulled from the registry. +} diff --git a/vendor/github.com/moby/moby/client/image_history_opts.go b/vendor/github.com/moby/moby/client/image_history_opts.go index 9641219f3..744d9fac9 100644 --- a/vendor/github.com/moby/moby/client/image_history_opts.go +++ b/vendor/github.com/moby/moby/client/image_history_opts.go @@ -1,8 +1,6 @@ package client -import ( - "github.com/moby/moby/api/types/image" -) +import ocispec "github.com/opencontainers/image-spec/specs-go/v1" // ImageHistoryOption is a type representing functional options for the image history operation. type ImageHistoryOption interface { @@ -15,5 +13,10 @@ func (f imageHistoryOptionFunc) Apply(o *imageHistoryOpts) error { } type imageHistoryOpts struct { - apiOptions image.HistoryOptions + apiOptions imageHistoryOptions +} + +type imageHistoryOptions struct { + // Platform from the manifest list to use for history. + Platform *ocispec.Platform } diff --git a/vendor/github.com/moby/moby/client/image_import.go b/vendor/github.com/moby/moby/client/image_import.go index b95438fbe..9db6a2103 100644 --- a/vendor/github.com/moby/moby/client/image_import.go +++ b/vendor/github.com/moby/moby/client/image_import.go @@ -7,12 +7,11 @@ import ( "strings" "github.com/distribution/reference" - "github.com/moby/moby/api/types/image" ) // ImageImport creates a new image based on the source options. // It returns the JSON content in the response body. -func (cli *Client) ImageImport(ctx context.Context, source image.ImportSource, ref string, options image.ImportOptions) (io.ReadCloser, error) { +func (cli *Client) ImageImport(ctx context.Context, source ImageImportSource, ref string, options ImageImportOptions) (io.ReadCloser, error) { if ref != "" { // Check if the given image name can be resolved if _, err := reference.ParseNormalizedNamed(ref); err != nil { diff --git a/vendor/github.com/moby/moby/client/image_import_opts.go b/vendor/github.com/moby/moby/client/image_import_opts.go new file mode 100644 index 000000000..c0c1c1b6d --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_import_opts.go @@ -0,0 +1,19 @@ +package client + +import ( + "io" +) + +// ImageImportSource holds source information for ImageImport +type ImageImportSource struct { + Source io.Reader // Source is the data to send to the server to create this image from. You must set SourceName to "-" to leverage this. + SourceName string // SourceName is the name of the image to pull. Set to "-" to leverage the Source attribute. +} + +// ImageImportOptions holds information to import images from the client host. +type ImageImportOptions struct { + Tag string // Tag is the name to tag this image with. This attribute is deprecated. + Message string // Message is the message to tag the image with + Changes []string // Changes are the raw changes to apply to this image + Platform string // Platform is the target platform of the image +} diff --git a/vendor/github.com/moby/moby/client/image_inspect_opts.go b/vendor/github.com/moby/moby/client/image_inspect_opts.go index 8b67519e7..93b5a9569 100644 --- a/vendor/github.com/moby/moby/client/image_inspect_opts.go +++ b/vendor/github.com/moby/moby/client/image_inspect_opts.go @@ -3,7 +3,6 @@ package client import ( "bytes" - "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -50,7 +49,7 @@ func ImageInspectWithPlatform(platform *ocispec.Platform) ImageInspectOption { } // ImageInspectWithAPIOpts sets the API options for the image inspect operation. -func ImageInspectWithAPIOpts(opts image.InspectOptions) ImageInspectOption { +func ImageInspectWithAPIOpts(opts ImageInspectOptions) ImageInspectOption { return imageInspectOptionFunc(func(clientOpts *imageInspectOpts) error { clientOpts.apiOptions = opts return nil @@ -59,5 +58,15 @@ func ImageInspectWithAPIOpts(opts image.InspectOptions) ImageInspectOption { type imageInspectOpts struct { raw *bytes.Buffer - apiOptions image.InspectOptions + apiOptions ImageInspectOptions +} + +type ImageInspectOptions struct { + // Manifests returns the image manifests. + Manifests bool + + // Platform selects the specific platform of a multi-platform image to inspect. + // + // This option is only available for API version 1.49 and up. + Platform *ocispec.Platform } diff --git a/vendor/github.com/moby/moby/client/image_list.go b/vendor/github.com/moby/moby/client/image_list.go index d29a7300e..fe5e0ea6a 100644 --- a/vendor/github.com/moby/moby/client/image_list.go +++ b/vendor/github.com/moby/moby/client/image_list.go @@ -16,7 +16,7 @@ import ( // to include [image.Summary.Manifests] with information about image manifests. // This is experimental and might change in the future without any backward // compatibility. -func (cli *Client) ImageList(ctx context.Context, options image.ListOptions) ([]image.Summary, error) { +func (cli *Client) ImageList(ctx context.Context, options ImageListOptions) ([]image.Summary, error) { var images []image.Summary // Make sure we negotiated (if the client is configured to do so), diff --git a/vendor/github.com/moby/moby/client/image_list_opts.go b/vendor/github.com/moby/moby/client/image_list_opts.go new file mode 100644 index 000000000..a4f76818e --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_list_opts.go @@ -0,0 +1,24 @@ +package client + +import "github.com/moby/moby/api/types/filters" + +// ImageListOptions holds parameters to list images with. +type ImageListOptions struct { + // All controls whether all images in the graph are filtered, or just + // the heads. + All bool + + // Filters is a JSON-encoded set of filter arguments. + Filters filters.Args + + // SharedSize indicates whether the shared size of images should be computed. + SharedSize bool + + // ContainerCount indicates whether container count should be computed. + // + // Deprecated: This field has been unused and is no longer required and will be removed in a future version. + ContainerCount bool + + // Manifests indicates whether the image manifests should be returned. + Manifests bool +} diff --git a/vendor/github.com/moby/moby/client/image_load_opts.go b/vendor/github.com/moby/moby/client/image_load_opts.go index 6681a63dd..8792f64a0 100644 --- a/vendor/github.com/moby/moby/client/image_load_opts.go +++ b/vendor/github.com/moby/moby/client/image_load_opts.go @@ -3,7 +3,6 @@ package client import ( "fmt" - "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -18,7 +17,16 @@ func (f imageLoadOptionFunc) Apply(o *imageLoadOpts) error { } type imageLoadOpts struct { - apiOptions image.LoadOptions + apiOptions imageLoadOptions +} + +type imageLoadOptions struct { + // Quiet suppresses progress output + Quiet bool + + // Platforms selects the platforms to load if the image is a + // multi-platform image and has multiple variants. + Platforms []ocispec.Platform } // ImageLoadWithQuiet sets the quiet option for the image load operation. diff --git a/vendor/github.com/moby/moby/client/image_pull.go b/vendor/github.com/moby/moby/client/image_pull.go index 2a9613db9..6cefaa947 100644 --- a/vendor/github.com/moby/moby/client/image_pull.go +++ b/vendor/github.com/moby/moby/client/image_pull.go @@ -8,14 +8,13 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/moby/moby/api/types/image" ) // ImagePull requests the docker host to pull an image from a remote registry. // It executes the privileged function if the operation is unauthorized // and it tries one more time. // It's up to the caller to handle the [io.ReadCloser] and close it. -func (cli *Client) ImagePull(ctx context.Context, refStr string, options image.PullOptions) (io.ReadCloser, error) { +func (cli *Client) ImagePull(ctx context.Context, refStr string, options ImagePullOptions) (io.ReadCloser, error) { // FIXME(vdemeester): there is currently used in a few way in docker/docker // - if not in trusted content, ref is used to pass the whole reference, and tag is empty // - if in trusted content, ref is used to pass the reference name, and tag for the digest diff --git a/vendor/github.com/moby/moby/client/image_pull_opts.go b/vendor/github.com/moby/moby/client/image_pull_opts.go new file mode 100644 index 000000000..618540902 --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_pull_opts.go @@ -0,0 +1,18 @@ +package client + +import "context" + +// ImagePullOptions holds information to pull images. +type ImagePullOptions struct { + All bool + RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry + + // PrivilegeFunc is a function that clients can supply to retry operations + // after getting an authorization error. This function returns the registry + // authentication header value in base64 encoded format, or an error if the + // privilege request fails. + // + // For details, refer to [github.com/moby/moby/api/types/registry.RequestAuthConfig]. + PrivilegeFunc func(context.Context) (string, error) + Platform string +} diff --git a/vendor/github.com/moby/moby/client/image_push.go b/vendor/github.com/moby/moby/client/image_push.go index e4a96a7eb..64165bc93 100644 --- a/vendor/github.com/moby/moby/client/image_push.go +++ b/vendor/github.com/moby/moby/client/image_push.go @@ -11,7 +11,6 @@ import ( cerrdefs "github.com/containerd/errdefs" "github.com/distribution/reference" - "github.com/moby/moby/api/types/image" "github.com/moby/moby/api/types/registry" ) @@ -19,7 +18,7 @@ import ( // It executes the privileged function if the operation is unauthorized // and it tries one more time. // It's up to the caller to handle the [io.ReadCloser] and close it. -func (cli *Client) ImagePush(ctx context.Context, image string, options image.PushOptions) (io.ReadCloser, error) { +func (cli *Client) ImagePush(ctx context.Context, image string, options ImagePushOptions) (io.ReadCloser, error) { ref, err := reference.ParseNormalizedNamed(image) if err != nil { return nil, err diff --git a/vendor/github.com/moby/moby/client/image_push_opts.go b/vendor/github.com/moby/moby/client/image_push_opts.go new file mode 100644 index 000000000..591c6b605 --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_push_opts.go @@ -0,0 +1,26 @@ +package client + +import ( + "context" + + ocispec "github.com/opencontainers/image-spec/specs-go/v1" +) + +// ImagePushOptions holds information to push images. +type ImagePushOptions struct { + All bool + RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry + + // PrivilegeFunc is a function that clients can supply to retry operations + // after getting an authorization error. This function returns the registry + // authentication header value in base64 encoded format, or an error if the + // privilege request fails. + // + // For details, refer to [github.com/moby/moby/api/types/registry.RequestAuthConfig]. + PrivilegeFunc func(context.Context) (string, error) + + // Platform is an optional field that selects a specific platform to push + // when the image is a multi-platform image. + // Using this will only push a single platform-specific manifest. + Platform *ocispec.Platform `json:",omitempty"` +} diff --git a/vendor/github.com/moby/moby/client/image_remove.go b/vendor/github.com/moby/moby/client/image_remove.go index fb3175e6a..738e647b3 100644 --- a/vendor/github.com/moby/moby/client/image_remove.go +++ b/vendor/github.com/moby/moby/client/image_remove.go @@ -9,7 +9,7 @@ import ( ) // ImageRemove removes an image from the docker host. -func (cli *Client) ImageRemove(ctx context.Context, imageID string, options image.RemoveOptions) ([]image.DeleteResponse, error) { +func (cli *Client) ImageRemove(ctx context.Context, imageID string, options ImageRemoveOptions) ([]image.DeleteResponse, error) { query := url.Values{} if options.Force { diff --git a/vendor/github.com/moby/moby/client/image_remove_opts.go b/vendor/github.com/moby/moby/client/image_remove_opts.go new file mode 100644 index 000000000..07161f58e --- /dev/null +++ b/vendor/github.com/moby/moby/client/image_remove_opts.go @@ -0,0 +1,10 @@ +package client + +import ocispec "github.com/opencontainers/image-spec/specs-go/v1" + +// ImageRemoveOptions holds parameters to remove images. +type ImageRemoveOptions struct { + Platforms []ocispec.Platform + Force bool + PruneChildren bool +} diff --git a/vendor/github.com/moby/moby/client/image_save_opts.go b/vendor/github.com/moby/moby/client/image_save_opts.go index 787e78bda..c51c2d535 100644 --- a/vendor/github.com/moby/moby/client/image_save_opts.go +++ b/vendor/github.com/moby/moby/client/image_save_opts.go @@ -3,7 +3,6 @@ package client import ( "fmt" - "github.com/moby/moby/api/types/image" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -29,5 +28,11 @@ func ImageSaveWithPlatforms(platforms ...ocispec.Platform) ImageSaveOption { } type imageSaveOpts struct { - apiOptions image.SaveOptions + apiOptions imageSaveOptions +} + +type imageSaveOptions struct { + // Platforms selects the platforms to save if the image is a + // multi-platform image and has multiple variants. + Platforms []ocispec.Platform } diff --git a/vendor/github.com/moby/moby/client/secret_list.go b/vendor/github.com/moby/moby/client/secret_list.go index 2ed1997a0..13879ba9f 100644 --- a/vendor/github.com/moby/moby/client/secret_list.go +++ b/vendor/github.com/moby/moby/client/secret_list.go @@ -10,7 +10,7 @@ import ( ) // SecretList returns the list of secrets. -func (cli *Client) SecretList(ctx context.Context, options swarm.SecretListOptions) ([]swarm.Secret, error) { +func (cli *Client) SecretList(ctx context.Context, options SecretListOptions) ([]swarm.Secret, error) { if err := cli.NewVersionError(ctx, "1.25", "secret list"); err != nil { return nil, err } diff --git a/vendor/github.com/moby/moby/client/secret_list_opts.go b/vendor/github.com/moby/moby/client/secret_list_opts.go new file mode 100644 index 000000000..313eeefe3 --- /dev/null +++ b/vendor/github.com/moby/moby/client/secret_list_opts.go @@ -0,0 +1,8 @@ +package client + +import "github.com/moby/moby/api/types/filters" + +// SecretListOptions holds parameters to list secrets +type SecretListOptions struct { + Filters filters.Args +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b780cea42..7f5496846 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -168,7 +168,7 @@ github.com/moby/docker-image-spec/specs-go/v1 github.com/moby/go-archive github.com/moby/go-archive/compression github.com/moby/go-archive/tarheader -# github.com/moby/moby/api v1.52.0-alpha.1.0.20250826164402-7145e7666b8f +# github.com/moby/moby/api v1.52.0-alpha.1.0.20250826224528-62884141100c ## explicit; go 1.23.0 github.com/moby/moby/api/pkg/authconfig github.com/moby/moby/api/pkg/progress @@ -194,7 +194,7 @@ github.com/moby/moby/api/types/swarm github.com/moby/moby/api/types/system github.com/moby/moby/api/types/versions github.com/moby/moby/api/types/volume -# github.com/moby/moby/client v0.1.0-alpha.0.0.20250826164402-7145e7666b8f +# github.com/moby/moby/client v0.1.0-alpha.0.0.20250826224528-62884141100c ## explicit; go 1.23.0 github.com/moby/moby/client github.com/moby/moby/client/internal/timestamp