From afb5e143b14ab0d3d97899eb263034971eedf64a Mon Sep 17 00:00:00 2001 From: Laura Brehm Date: Thu, 1 Aug 2024 12:32:30 +0100 Subject: [PATCH] login: normalize `registry-1.docker.io` Signed-off-by: Laura Brehm (cherry picked from commit e6624676e07d718f09d97889ced8d98a0fcf628f) Signed-off-by: Laura Brehm --- cli/command/registry/login.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/command/registry/login.go b/cli/command/registry/login.go index 1cde6f8255..1a40213eac 100644 --- a/cli/command/registry/login.go +++ b/cli/command/registry/login.go @@ -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