From 2a558c2082601892953fc214c578f7d47565dcc9 Mon Sep 17 00:00:00 2001 From: wangxiaoxuan273 Date: Thu, 20 Apr 2023 02:40:25 +0000 Subject: [PATCH] resolved comments Signed-off-by: wangxiaoxuan273 --- registry.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/registry.go b/registry.go index 234af80..392dcfc 100644 --- a/registry.go +++ b/registry.go @@ -75,20 +75,20 @@ func Credential(store Store) func(context.Context, string) (auth.Credential, err } } -// The Docker CLI expects that the 'docker.io' credential -// will be added under the key "https://index.docker.io/v1/" func mapStoreRegistryName(registry string) string { + // The Docker CLI expects that the 'docker.io' credential + // will be added under the key "https://index.docker.io/v1/" if registry == "docker.io" { return "https://index.docker.io/v1/" } return registry } -// It is expected that the traffic targetting "registry-1.docker.io" -// will be redirected to "https://index.docker.io/v1/" -func mapAuthenticationRegistryName(target string) string { - if target == "registry-1.docker.io" { +func mapAuthenticationRegistryName(hostname string) string { + // It is expected that the traffic targetting "registry-1.docker.io" + // will be redirected to "https://index.docker.io/v1/" + if hostname == "registry-1.docker.io" { return "https://index.docker.io/v1/" } - return target + return hostname }