mirror of https://github.com/docker/docs.git
Remove leading spaces of username when login
When we run `docker login` we will be asked to input our username. Prior to this PR, "userA" and " userA" will be considered as two diferrent user, which is not right. Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
parent
93e78ac8e7
commit
2687502ba4
|
@ -344,6 +344,7 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
|
||||||
if username == "" {
|
if username == "" {
|
||||||
promptDefault("Username", authconfig.Username)
|
promptDefault("Username", authconfig.Username)
|
||||||
username = readInput(cli.in, cli.out)
|
username = readInput(cli.in, cli.out)
|
||||||
|
username = strings.Trim(username, " ")
|
||||||
if username == "" {
|
if username == "" {
|
||||||
username = authconfig.Username
|
username = authconfig.Username
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue