fix: legacy docker support broken for login
build-test / build (push) Has been cancelled Details
golangci-lint / golangci-lint (push) Has been cancelled Details

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
This commit is contained in:
Terry Howe 2025-05-29 19:32:55 -04:00 committed by Scott Rigby
parent bc9f8a2d8b
commit 04cad46100
No known key found for this signature in database
GPG Key ID: C7C6FBB5B91C1155
1 changed files with 2 additions and 2 deletions

View File

@ -301,8 +301,6 @@ func (c *Client) Login(host string, options ...LoginOption) error {
return fmt.Errorf("authenticating to %q: %w", host, err) return fmt.Errorf("authenticating to %q: %w", host, err)
} }
key := credentials.ServerAddressFromRegistry(host)
// The credentialsStore loader does not handle empty files. So, there is a workaround. // The credentialsStore loader does not handle empty files. So, there is a workaround.
// This can be removed when the credentials loader can handle empty files. // This can be removed when the credentials loader can handle empty files.
// When Helm catches an empty file error it causes the loader to trigger its fault // When Helm catches an empty file error it causes the loader to trigger its fault
@ -327,6 +325,8 @@ func (c *Client) Login(host string, options ...LoginOption) error {
c.credentialsFileTemp = false c.credentialsFileTemp = false
} }
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
} }