Ver Fonte

fix error when auth config is nil

Alexander Belanger há 4 anos atrás
pai
commit
0f42ce7bbc
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      cli/cmd/docker.go

+ 4 - 0
cli/cmd/docker.go

@@ -138,6 +138,10 @@ func dockerConfig(user *api.AuthCheckResponse, client *api.Client, args []string
 		configFile.CredentialHelpers = make(map[string]string)
 	}
 
+	if configFile.AuthConfigs == nil {
+		configFile.AuthConfigs = make(map[string]types.AuthConfig)
+	}
+
 	for _, regURL := range regToAdd {
 		// if this is a dockerhub registry, see if an auth config has already been generated
 		// for index.docker.io