Skip to content

Commit 7d75592

Browse files
author
Prince Rachit Sinha
committed
[image-builder] Use Additional auth to override existing base auth
1 parent 641adda commit 7d75592

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/image-builder-bob/cmd/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var proxyCmd = &cobra.Command{
3939
if err != nil {
4040
log.WithError(err).WithField("auth", proxyOpts.Auth).Fatal("cannot unmarshal auth")
4141
}
42-
authP = authP.AddIfNotExists(authA)
42+
authP = authP.OverrideWith(authA)
4343

4444
baseref, err := reference.ParseNormalizedNamed(proxyOpts.BaseRef)
4545
if err != nil {

components/image-builder-bob/pkg/proxy/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (a MapAuthorizer) Authorize(host string) (user, pass string, err error) {
5454
return
5555
}
5656

57-
func (a MapAuthorizer) AddIfNotExists(other MapAuthorizer) MapAuthorizer {
57+
func (a MapAuthorizer) OverrideWith(other MapAuthorizer) MapAuthorizer {
5858
res := make(map[string]authConfig)
5959
for k, v := range a {
6060
res[k] = v

0 commit comments

Comments
 (0)