login: normalize `registry-1.docker.io`

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
(cherry picked from commit e6624676e0)
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
This commit is contained in:
Laura Brehm 2024-08-01 12:32:30 +01:00
parent b8a38fd22d
commit afb5e143b1
No known key found for this signature in database
GPG Key ID: 08EC1B0491948487
1 changed files with 3 additions and 1 deletions

View File

@ -109,7 +109,9 @@ func runLogin(ctx context.Context, dockerCli command.Cli, opts loginOptions) err
serverAddress string
response *registrytypes.AuthenticateOKBody
)
if opts.serverAddress != "" && opts.serverAddress != registry.DefaultNamespace {
if opts.serverAddress != "" &&
opts.serverAddress != registry.DefaultNamespace &&
opts.serverAddress != registry.DefaultRegistryHost {
serverAddress = opts.serverAddress
} else {
serverAddress = registry.IndexServer