daemon: use types/registry.AuthConfig

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-03-03 10:30:47 +01:00
parent 39f3adc079
commit a02abca49a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 6 additions and 6 deletions

View File

@ -3,11 +3,11 @@ package daemon // import "github.com/docker/docker/daemon"
import ( import (
"context" "context"
"github.com/docker/docker/api/types" "github.com/docker/docker/api/types/registry"
"github.com/docker/docker/dockerversion" "github.com/docker/docker/dockerversion"
) )
// AuthenticateToRegistry checks the validity of credentials in authConfig // 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)) return daemon.registryService.Auth(ctx, authConfig, dockerversion.DockerUserAgent(ctx))
} }

View File

@ -25,8 +25,8 @@ import (
type ImageService interface { type ImageService interface {
// Images // Images
PullImage(ctx context.Context, image, tag string, platform *v1.Platform, 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 *types.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) CreateImage(config []byte, parent string) (builder.Image, error)
ImageDelete(imageRef string, force, prune bool) ([]types.ImageDeleteResponseItem, error) ImageDelete(imageRef string, force, prune bool) ([]types.ImageDeleteResponseItem, error)
ExportImage(names []string, outStream io.Writer) error ExportImage(names []string, outStream io.Writer) error
@ -67,8 +67,8 @@ type ImageService interface {
// Other // Other
GetRepository(ctx context.Context, ref reference.Named, authConfig *types.AuthConfig) (distribution.Repository, 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 *types.AuthConfig, headers map[string][]string) (*registry.SearchResults, 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 DistributionServices() images.DistributionServices
Children(id image.ID) []image.ID Children(id image.ID) []image.ID
Cleanup() error Cleanup() error