diff --git a/registry.go b/registry.go index 67b3f43..0a6efdd 100644 --- a/registry.go +++ b/registry.go @@ -79,15 +79,16 @@ func Credential(store Store) func(context.Context, string) (auth.Credential, err // will be added under the key "https://index.docker.io/v1/" func getLoginRegistry(hostname string) string { if hostname == "docker.io" { - return "https://index.docker.io/v1/" // Login用的 + return "https://index.docker.io/v1/" } return hostname } -// The behavior +// It is expected that the traffic targetting "registry-1.docker.io" +// will be redirected to "https://index.docker.io/v1/" func getTargetRegistry(target string) string { if target == "registry-1.docker.io" { - return "https://index.docker.io/v1/" // Credential用的 + return "https://index.docker.io/v1/" } return target } diff --git a/registry_test.go b/registry_test.go index a2f5f68..fe5bc82 100644 --- a/registry_test.go +++ b/registry_test.go @@ -198,11 +198,6 @@ func TestCredential(t *testing.T) { registry: "localhost:2333", wantCredential: auth.Credential{Username: "test_user", Password: "test_word"}, }, - { - name: "get credentials for docker.io", - registry: "docker.io", - wantCredential: auth.Credential{Username: "user", Password: "word"}, - }, { name: "get credentials for registry-1.docker.io", registry: "registry-1.docker.io",