diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-06 16:50:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 16:50:12 +0100 |
commit | 2fd6c2ee89e92ced8568d7ed3ea3f04017b154ed (patch) | |
tree | 39e835e37435e938be7eb4a8a3dd7946ae2016f3 /pkg/bindings/images/build.go | |
parent | c0b3df805999551db1da8ec2866457c555e627c7 (diff) | |
parent | 5bbcfaf4aa4f276423d9fae31aee5945b7f5a9b8 (diff) | |
download | podman-2fd6c2ee89e92ced8568d7ed3ea3f04017b154ed.tar.gz podman-2fd6c2ee89e92ced8568d7ed3ea3f04017b154ed.tar.bz2 podman-2fd6c2ee89e92ced8568d7ed3ea3f04017b154ed.zip |
Merge pull request #11538 from mtrmac/http-credentials
Fix HTTP credentials passing
Diffstat (limited to 'pkg/bindings/images/build.go')
-rw-r--r-- | pkg/bindings/images/build.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index be6e5ab55..7bca43132 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -293,14 +293,10 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO headers map[string]string err error ) - if options.SystemContext == nil { - headers, err = auth.Header(options.SystemContext, auth.XRegistryConfigHeader, "", "", "") + if options.SystemContext != nil && options.SystemContext.DockerAuthConfig != nil { + headers, err = auth.MakeXRegistryAuthHeader(options.SystemContext, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password) } else { - if options.SystemContext.DockerAuthConfig != nil { - headers, err = auth.Header(options.SystemContext, auth.XRegistryAuthHeader, options.SystemContext.AuthFilePath, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password) - } else { - headers, err = auth.Header(options.SystemContext, auth.XRegistryConfigHeader, options.SystemContext.AuthFilePath, "", "") - } + headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "") } if err != nil { return nil, err |