diff options
author | baude <bbaude@redhat.com> | 2018-04-16 13:39:00 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-18 14:07:59 +0000 |
commit | 313e5e83e92f68349d2026fc3f358f237fe93a4a (patch) | |
tree | 91c523b44bb8f55790037a9a7b42bf63e3c90de6 /cmd/podman/pull.go | |
parent | 982927468c6102cfc52e838be4815d2f89d3827e (diff) | |
download | podman-313e5e83e92f68349d2026fc3f358f237fe93a4a.tar.gz podman-313e5e83e92f68349d2026fc3f358f237fe93a4a.tar.bz2 podman-313e5e83e92f68349d2026fc3f358f237fe93a4a.zip |
regression: tls verify should be set on registries.conf if insecure
In the case where podman needs to pull an image, if that registry that the image
resides on is known to be insesure (as defined in /etc/containers/registries.conf),
tls-verify should be altered on the fly.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #626
Approved by: mheon
Diffstat (limited to 'cmd/podman/pull.go')
-rw-r--r-- | cmd/podman/pull.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go index 4ceae4596..43169635a 100644 --- a/cmd/podman/pull.go +++ b/cmd/podman/pull.go @@ -58,6 +58,7 @@ var ( // pullCmd gets the data from the command line and calls pullImage // to copy an image from a registry to a local machine func pullCmd(c *cli.Context) error { + forceSecure := true runtime, err := getRuntime(c) if err != nil { return errors.Wrapf(err, "could not get runtime") @@ -98,8 +99,11 @@ func pullCmd(c *cli.Context) error { DockerCertPath: c.String("cert-dir"), DockerInsecureSkipTLSVerify: !c.BoolT("tls-verify"), } + if !c.IsSet("tls-verify") { + forceSecure = false + } - newImage, err := runtime.ImageRuntime().New(image, c.String("signature-policy"), c.String("authfile"), writer, &dockerRegistryOptions, image2.SigningOptions{}, true) + newImage, err := runtime.ImageRuntime().New(image, c.String("signature-policy"), c.String("authfile"), writer, &dockerRegistryOptions, image2.SigningOptions{}, true, forceSecure) if err != nil { return errors.Wrapf(err, "error pulling image %q", image) } |