Merge pull request #4985 from baude/pushhidden

Hidden remote flags can be nil
This commit is contained in:
OpenShift Merge Robot 2020-01-27 04:22:21 -08:00 committed by GitHub
commit 2d9d5e7606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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)
}