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

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

View File

@ -88,7 +88,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