Remove unnecessary call to /info

Avoid using the `/info` endpoint in the `login` and `logout` workflows
when the Registry endpoint is overriden by the user through the command
line.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
Arnaud Porterie 2016-02-03 10:30:17 -08:00 committed by Tibor Vass
parent 0438c9bd3a
commit e7efe99042
2 changed files with 6 additions and 2 deletions

View File

@ -35,9 +35,11 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
cli.in = os.Stdin
}
serverAddress := cli.electAuthServer()
var serverAddress string
if len(cmd.Args()) > 0 {
serverAddress = cmd.Arg(0)
} else {
serverAddress = cli.electAuthServer()
}
authConfig, err := cli.configureAuth(*flUser, *flPassword, *flEmail, serverAddress)

View File

@ -18,9 +18,11 @@ func (cli *DockerCli) CmdLogout(args ...string) error {
cmd.ParseFlags(args, true)
serverAddress := cli.electAuthServer()
var serverAddress string
if len(cmd.Args()) > 0 {
serverAddress = cmd.Arg(0)
} else {
serverAddress = cli.electAuthServer()
}
if _, ok := cli.configFile.AuthConfigs[serverAddress]; !ok {