From 360d38adb16921e85670cfd83c67237f16475aa7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 29 Jul 2022 15:36:39 +0200 Subject: [PATCH] daemon/containerd: use types/registry.AuthConfig Signed-off-by: Sebastiaan van Stijn --- daemon/containerd/image_pull.go | 6 +++--- daemon/containerd/image_push.go | 4 ++-- daemon/containerd/image_search.go | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/daemon/containerd/image_pull.go b/daemon/containerd/image_pull.go index fc5eff891d..2cfaa6bc4a 100644 --- a/daemon/containerd/image_pull.go +++ b/daemon/containerd/image_pull.go @@ -8,7 +8,7 @@ import ( "github.com/containerd/containerd/platforms" "github.com/docker/distribution" "github.com/docker/distribution/reference" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/registry" "github.com/docker/docker/errdefs" "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go/v1" @@ -16,7 +16,7 @@ import ( // PullImage initiates a pull operation. image is the repository name to pull, and // tagOrDigest may be either empty, or indicate a specific tag or digest to pull. -func (i *ImageService) PullImage(ctx context.Context, image, tagOrDigest string, platform *specs.Platform, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error { +func (i *ImageService) PullImage(ctx context.Context, image, tagOrDigest string, platform *specs.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error { var opts []containerd.RemoteOpt if platform != nil { opts = append(opts, containerd.WithPlatform(platforms.Format(*platform))) @@ -46,6 +46,6 @@ func (i *ImageService) PullImage(ctx context.Context, image, tagOrDigest string, } // GetRepository returns a repository from the registry. -func (i *ImageService) GetRepository(ctx context.Context, ref reference.Named, authConfig *types.AuthConfig) (distribution.Repository, error) { +func (i *ImageService) GetRepository(ctx context.Context, ref reference.Named, authConfig *registry.AuthConfig) (distribution.Repository, error) { panic("not implemented") } diff --git a/daemon/containerd/image_push.go b/daemon/containerd/image_push.go index 584bb58045..73390f0406 100644 --- a/daemon/containerd/image_push.go +++ b/daemon/containerd/image_push.go @@ -4,10 +4,10 @@ import ( "context" "io" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/registry" ) // PushImage initiates a push operation on the repository named localName. -func (i *ImageService) PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error { +func (i *ImageService) PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error { panic("not implemented") } diff --git a/daemon/containerd/image_search.go b/daemon/containerd/image_search.go index d2b3cd858c..5524fb9906 100644 --- a/daemon/containerd/image_search.go +++ b/daemon/containerd/image_search.go @@ -3,9 +3,8 @@ package containerd import ( "context" - "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - registrytypes "github.com/docker/docker/api/types/registry" + "github.com/docker/docker/api/types/registry" ) // SearchRegistryForImages queries the registry for images matching @@ -13,6 +12,6 @@ import ( // // TODO: this could be implemented in a registry service instead of the image // service. -func (i *ImageService) SearchRegistryForImages(ctx context.Context, searchFilters filters.Args, term string, limit int, authConfig *types.AuthConfig, metaHeaders map[string][]string) (*registrytypes.SearchResults, error) { +func (i *ImageService) SearchRegistryForImages(ctx context.Context, searchFilters filters.Args, term string, limit int, authConfig *registry.AuthConfig, metaHeaders map[string][]string) (*registry.SearchResults, error) { panic("not implemented") }