fix(registry): remove redundant ServerAddressFromHostname in Login (#32681)

In (*Client).Login(), credentials.ServerAddressFromHostname(key) was
originally added in commit 6ab7aa361 as a workaround for oras-go v2.6.0
where ServerAddressFromRegistry("registry-1.docker.io") did not return
the canonical https://index.docker.io/v1/.

Since oras-go was bumped to v2.6.2 (which incorporates oras-project/oras-go#966),
ServerAddressFromRegistry already normalizes both "docker.io" and
"registry-1.docker.io" properly, making this second call redundant.

Closes #32681

Signed-off-by: abdouladieng <diengabdoulaziz110@gmail.com>
pull/32685/head
abdouladieng 1 week ago
parent d31cd6992f
commit b9c733f4d4

@ -266,7 +266,6 @@ func (c *Client) Login(host string, options ...LoginOption) error {
c.authorizer.ForceAttemptOAuth2 = false c.authorizer.ForceAttemptOAuth2 = false
key := credentials.ServerAddressFromRegistry(host) key := credentials.ServerAddressFromRegistry(host)
key = credentials.ServerAddressFromHostname(key)
if err := c.credentialsStore.Put(ctx, key, cred); err != nil { if err := c.credentialsStore.Put(ctx, key, cred); err != nil {
return err return err
} }

Loading…
Cancel
Save