Skip to content

Commit

Permalink
Merge pull request #340 from scothis/preserve-keychain
Browse files Browse the repository at this point in the history
Avoid overwriting user defined registry options
  • Loading branch information
joaopapereira authored Feb 22, 2022
2 parents 8025345 + c3de94a commit 909c67d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/imgpkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ func (r SimpleRegistry) CloneWithSingleAuth(imageRef regname.Tag) (Registry, err

// opts Returns the opts + the keychain
func (r SimpleRegistry) opts() []regremote.Option {
return append(r.remoteOpts, regremote.WithAuthFromKeychain(r.keychain))
// new options come first so that user configured options take precedence
return append([]regremote.Option{regremote.WithAuthFromKeychain(r.keychain)}, r.remoteOpts...)
}

// Get Retrieve Image descriptor for an Image reference
Expand Down

0 comments on commit 909c67d

Please sign in to comment.