aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-01-26 14:51:01 -0600
committerBrent Baude <bbaude@redhat.com>2020-01-26 14:53:22 -0600
commit7f69669a3ad1657c59b66d68cba8ace422b4da16 (patch)
tree7e8d85898d94096b0016102b500c5d86ac4ddcb4
parent40d36b1cf11be8f6e102a4bf28144d33082b453a (diff)
downloadpodman-7f69669a3ad1657c59b66d68cba8ace422b4da16.tar.gz
podman-7f69669a3ad1657c59b66d68cba8ace422b4da16.tar.bz2
podman-7f69669a3ad1657c59b66d68cba8ace422b4da16.zip
Hidden remote flags can be nil
The pull command has several options that are hidden for the remote client. In that case, when checking to see if the flag has been flipped with .Changed, we get a nil pointer error. Using IsSet is tolerant of this. Fixes: #4706 Signed-off-by: Brent Baude <bbaude@redhat.com>
-rw-r--r--cmd/podman/push.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/podman/push.go b/cmd/podman/push.go
index 1be8dfe11..b078959ba 100644
--- a/cmd/podman/push.go
+++ b/cmd/podman/push.go
@@ -100,7 +100,8 @@ func pushCmd(c *cliconfig.PushValues) error {
// --compress and --format can only be used for the "dir" transport
splitArg := strings.SplitN(destName, ":", 2)
- if c.Flag("compress").Changed || c.Flag("format").Changed {
+
+ if c.IsSet("compress") || c.Flag("format").Changed {
if splitArg[0] != directory.Transport.Name() {
return errors.Errorf("--compress and --format can be set only when pushing to a directory using the 'dir' transport")
}
@@ -141,7 +142,7 @@ func pushCmd(c *cliconfig.PushValues) error {
DockerRegistryCreds: registryCreds,
DockerCertPath: certPath,
}
- if c.Flag("tls-verify").Changed {
+ if c.IsSet("tls-verify") {
dockerRegistryOptions.DockerInsecureSkipTLSVerify = types.NewOptionalBool(!c.TlsVerify)
}