Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/imgutil/dockerconfigresolver/credentialsstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (cs *CredentialsStore) Store(registryURL *RegistryURL, credentials *Credent
if registryURL.Namespace != nil {
credentials.ServerAddress = fmt.Sprintf("%s%s?%s", registryURL.Host, registryURL.Path, registryURL.RawQuery)
} else {
credentials.ServerAddress = registryURL.Host
credentials.ServerAddress = registryURL.CanonicalIdentifier()
}

// XXX future namespaced url likely require special handling here
Expand Down
2 changes: 2 additions & 0 deletions pkg/imgutil/dockerconfigresolver/credentialsstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,5 @@ func TestWorkingCredentialsStore(t *testing.T) {

})
}

// TODO: add more tests that write credentials (specifically to hub locations) to verify they use the canonical id properly
5 changes: 5 additions & 0 deletions pkg/imgutil/dockerconfigresolver/registryurl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ func TestURLParsingAndID(t *testing.T) {
address: "whatever://",
error: ErrUnsupportedScheme,
},
{
address: "",
identifier: "https://index.docker.io/v1/",
allIDs: []string{"https://index.docker.io/v1/"},
},
{
address: "https://index.docker.io/v1/",
identifier: "https://index.docker.io/v1/",
Expand Down