Browse code

Merge pull request #31057 from krasi-georgiev/30779-fix-client-login-credentials-save-domain

fix incorect login client credential save when the registry is the default docker registry

Akihiro Suda authored on 2017/03/16 13:19:32
Showing 1 changed files
... ...
@@ -7,6 +7,7 @@ import (
7 7
 
8 8
 	"github.com/docker/docker/cli"
9 9
 	"github.com/docker/docker/cli/command"
10
+	"github.com/docker/docker/registry"
10 11
 	"github.com/spf13/cobra"
11 12
 )
12 13
 
... ...
@@ -54,7 +55,7 @@ func runLogin(dockerCli *command.DockerCli, opts loginOptions) error {
54 54
 		serverAddress string
55 55
 		authServer    = command.ElectAuthServer(ctx, dockerCli)
56 56
 	)
57
-	if opts.serverAddress != "" {
57
+	if opts.serverAddress != "" && opts.serverAddress != registry.DefaultNamespace {
58 58
 		serverAddress = opts.serverAddress
59 59
 	} else {
60 60
 		serverAddress = authServer