Переглянути джерело

c8d/authorizer: Default to docker.io

When the `ServerAddress` in the `AuthConfig` provided by the client is
empty, default to the default registry (registry-1.docker.io).

This makes the behaviour the same as with the containerd image store
integration disabled.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 2ad499f93e4b5117246ceffb8deb2bd6d9966fd2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Paweł Gronowski 2 роки тому
батько
коміт
2b7424512a
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      daemon/containerd/resolver.go

+ 1 - 1
daemon/containerd/resolver.go

@@ -51,7 +51,7 @@ func hostsWrapper(hostsFn docker.RegistryHosts, authConfig *registrytypes.AuthCo
 
 func authorizationCredsFromAuthConfig(authConfig registrytypes.AuthConfig) docker.AuthorizerOpt {
 	cfgHost := registry.ConvertToHostname(authConfig.ServerAddress)
-	if cfgHost == registry.IndexHostname {
+	if cfgHost == "" || cfgHost == registry.IndexHostname {
 		cfgHost = registry.DefaultRegistryHost
 	}