From a02abca49af514fdbaa645e802a3762a54d3c193 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 3 Mar 2022 10:30:47 +0100 Subject: [PATCH] daemon: use types/registry.AuthConfig Signed-off-by: Sebastiaan van Stijn --- daemon/auth.go | 4 ++-- daemon/image_service.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/auth.go b/daemon/auth.go index e97d888371..421a7f7945 100644 --- a/daemon/auth.go +++ b/daemon/auth.go @@ -3,11 +3,11 @@ package daemon // import "github.com/docker/docker/daemon" import ( "context" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/registry" "github.com/docker/docker/dockerversion" ) // AuthenticateToRegistry checks the validity of credentials in authConfig -func (daemon *Daemon) AuthenticateToRegistry(ctx context.Context, authConfig *types.AuthConfig) (string, string, error) { +func (daemon *Daemon) AuthenticateToRegistry(ctx context.Context, authConfig *registry.AuthConfig) (string, string, error) { return daemon.registryService.Auth(ctx, authConfig, dockerversion.DockerUserAgent(ctx)) } diff --git a/daemon/image_service.go b/daemon/image_service.go index 032a9977e5..729ae8cc93 100644 --- a/daemon/image_service.go +++ b/daemon/image_service.go @@ -25,8 +25,8 @@ import ( type ImageService interface { // Images - PullImage(ctx context.Context, image, tag string, platform *v1.Platform, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error - PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error + PullImage(ctx context.Context, image, tag string, platform *v1.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error + PushImage(ctx context.Context, image, tag string, metaHeaders map[string][]string, authConfig *registry.AuthConfig, outStream io.Writer) error CreateImage(config []byte, parent string) (builder.Image, error) ImageDelete(imageRef string, force, prune bool) ([]types.ImageDeleteResponseItem, error) ExportImage(names []string, outStream io.Writer) error @@ -67,8 +67,8 @@ type ImageService interface { // Other - GetRepository(ctx context.Context, ref reference.Named, authConfig *types.AuthConfig) (distribution.Repository, error) - SearchRegistryForImages(ctx context.Context, searchFilters filters.Args, term string, limit int, authConfig *types.AuthConfig, headers map[string][]string) (*registry.SearchResults, error) + GetRepository(ctx context.Context, ref reference.Named, authConfig *registry.AuthConfig) (distribution.Repository, error) + SearchRegistryForImages(ctx context.Context, searchFilters filters.Args, term string, limit int, authConfig *registry.AuthConfig, headers map[string][]string) (*registry.SearchResults, error) DistributionServices() images.DistributionServices Children(id image.ID) []image.ID Cleanup() error