diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-04-24 07:00:08 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-04-25 13:47:11 -0400 |
commit | 3d1e4060819be8ae28f99da945ab4df23bf9638d (patch) | |
tree | 6be45bb945a4a1efe775b58d1bfde875f934d126 /pkg/bindings/images | |
parent | f65f3320e1124c94db053c1f811487920ae2a70e (diff) | |
download | podman-3d1e4060819be8ae28f99da945ab4df23bf9638d.tar.gz podman-3d1e4060819be8ae28f99da945ab4df23bf9638d.tar.bz2 podman-3d1e4060819be8ae28f99da945ab4df23bf9638d.zip |
Pass --tls-verify option in podman -remote build
Fixes: https://github.com/containers/podman/issues/13979
[NO NEW TESTS NEEDED] Buildah has a test for this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r-- | pkg/bindings/images/build.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index 15900a2ed..1729bd922 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -312,10 +312,15 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO var ( headers http.Header ) - if options.SystemContext != nil && options.SystemContext.DockerAuthConfig != nil { - headers, err = auth.MakeXRegistryAuthHeader(options.SystemContext, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password) - } else { - headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "") + if options.SystemContext != nil { + if options.SystemContext.DockerAuthConfig != nil { + headers, err = auth.MakeXRegistryAuthHeader(options.SystemContext, options.SystemContext.DockerAuthConfig.Username, options.SystemContext.DockerAuthConfig.Password) + } else { + headers, err = auth.MakeXRegistryConfigHeader(options.SystemContext, "", "") + } + if options.SystemContext.DockerInsecureSkipTLSVerify == types.OptionalBoolTrue { + params.Set("tlsVerify", "false") + } } if err != nil { return nil, err |