summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDjordje Lukic <djordje.lukic@docker.com>2023-05-12 09:33:10 +0200
committerDjordje Lukic <djordje.lukic@docker.com>2023-05-12 09:41:34 +0200
commit348a79958daeb79e17409108f8e6fb72c2f940a4 (patch)
treebdebd0e25a9ce2d0c6bec7a109b9e461ceb157d9
parent9e6370819bf61de7583ea00af13fcbedd2bbbfe7 (diff)
downloaddocker-348a79958daeb79e17409108f8e6fb72c2f940a4.tar.gz
c8d: The authorizer needs to be set even if AuthConfig is empty
Without the authorizer pulling will fail if the user is not logged-in Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
-rw-r--r--daemon/containerd/resolver.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/daemon/containerd/resolver.go b/daemon/containerd/resolver.go
index 5b2d1dff4c..5edd83181b 100644
--- a/daemon/containerd/resolver.go
+++ b/daemon/containerd/resolver.go
@@ -27,10 +27,7 @@ func (i *ImageService) newResolverFromAuthConfig(authConfig *registrytypes.AuthC
func hostsWrapper(hostsFn docker.RegistryHosts, optAuthConfig *registrytypes.AuthConfig, regService RegistryConfigProvider) docker.RegistryHosts {
var authorizer docker.Authorizer
if optAuthConfig != nil {
- auth := *optAuthConfig
- if auth != (registrytypes.AuthConfig{}) {
- authorizer = docker.NewDockerAuthorizer(authorizationCredsFromAuthConfig(auth))
- }
+ authorizer = docker.NewDockerAuthorizer(authorizationCredsFromAuthConfig(*optAuthConfig))
}
return func(n string) ([]docker.RegistryHost, error) {