From 06f0d0bf6e3fd595d3726680a0ea1bc828b0cab9 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 18 Apr 2018 10:59:40 -0400 Subject: Refactor logic for forceSecure in pull for readability Signed-off-by: Matthew Heon Closes: #636 Approved by: rhatdan --- cmd/podman/pull.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd/podman') diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go index 670d6d4fc..cab549a02 100644 --- a/cmd/podman/pull.go +++ b/cmd/podman/pull.go @@ -58,7 +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 + forceSecure := false runtime, err := getRuntime(c) if err != nil { return errors.Wrapf(err, "could not get runtime") @@ -99,8 +99,8 @@ func pullCmd(c *cli.Context) error { DockerCertPath: c.String("cert-dir"), DockerInsecureSkipTLSVerify: !c.BoolT("tls-verify"), } - if !c.IsSet("tls-verify") || !c.Bool("tls-verify") { - forceSecure = false + if c.IsSet("tls-verify") { + forceSecure = c.Bool("tls-verify") } newImage, err := runtime.ImageRuntime().New(image, c.String("signature-policy"), c.String("authfile"), writer, &dockerRegistryOptions, image2.SigningOptions{}, true, forceSecure) -- cgit v1.2.3-54-g00ecf