diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-11-18 20:47:33 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-11-19 13:55:10 -0500 |
commit | 21629b0501c62a991eef536765b7320bc2d45763 (patch) | |
tree | 38404b476151b3e601c9f9648ae47e6bda167a9f /cmd/podman/images | |
parent | 2755d0255c94ac2ef797636935f83e3351d4d5af (diff) | |
download | podman-21629b0501c62a991eef536765b7320bc2d45763.tar.gz podman-21629b0501c62a991eef536765b7320bc2d45763.tar.bz2 podman-21629b0501c62a991eef536765b7320bc2d45763.zip |
podman-remote does not support signature-policy
Fixes: https://github.com/containers/podman/issues/12357
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r-- | cmd/podman/images/import.go | 6 | ||||
-rw-r--r-- | cmd/podman/images/load.go | 6 | ||||
-rw-r--r-- | cmd/podman/images/pull.go | 6 | ||||
-rw-r--r-- | cmd/podman/images/push.go | 6 |
4 files changed, 16 insertions, 8 deletions
diff --git a/cmd/podman/images/import.go b/cmd/podman/images/import.go index d4bc0f610..3b6788f4a 100644 --- a/cmd/podman/images/import.go +++ b/cmd/podman/images/import.go @@ -77,8 +77,10 @@ func importFlags(cmd *cobra.Command) { _ = cmd.RegisterFlagCompletionFunc(messageFlagName, completion.AutocompleteNone) flags.BoolVarP(&importOpts.Quiet, "quiet", "q", false, "Suppress output") - flags.StringVar(&importOpts.SignaturePolicy, "signature-policy", "", "Path to a signature-policy file") - _ = flags.MarkHidden("signature-policy") + if !registry.IsRemote() { + flags.StringVar(&importOpts.SignaturePolicy, "signature-policy", "", "Path to a signature-policy file") + _ = flags.MarkHidden("signature-policy") + } } func importCon(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go index c39ae624e..5cd410f5c 100644 --- a/cmd/podman/images/load.go +++ b/cmd/podman/images/load.go @@ -64,8 +64,10 @@ func loadFlags(cmd *cobra.Command) { _ = cmd.RegisterFlagCompletionFunc(inputFlagName, completion.AutocompleteDefault) flags.BoolVarP(&loadOpts.Quiet, "quiet", "q", false, "Suppress the output") - flags.StringVar(&loadOpts.SignaturePolicy, "signature-policy", "", "Pathname of signature policy file") - _ = flags.MarkHidden("signature-policy") + if !registry.IsRemote() { + flags.StringVar(&loadOpts.SignaturePolicy, "signature-policy", "", "Pathname of signature policy file") + _ = flags.MarkHidden("signature-policy") + } } func load(cmd *cobra.Command, args []string) error { diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index a990d1626..2a5fd86cc 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -101,7 +101,6 @@ func pullFlags(cmd *cobra.Command) { flags.Bool("disable-content-trust", false, "This is a Docker specific option and is a NOOP") flags.BoolVarP(&pullOptions.Quiet, "quiet", "q", false, "Suppress output information when pulling images") - flags.StringVar(&pullOptions.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)") flags.BoolVar(&pullOptions.TLSVerifyCLI, "tls-verify", true, "Require HTTPS and verify certificates when contacting registries") authfileFlagName := "authfile" @@ -113,7 +112,10 @@ func pullFlags(cmd *cobra.Command) { flags.StringVar(&pullOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys") _ = cmd.RegisterFlagCompletionFunc(certDirFlagName, completion.AutocompleteDefault) } - _ = flags.MarkHidden("signature-policy") + if !registry.IsRemote() { + flags.StringVar(&pullOptions.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)") + _ = flags.MarkHidden("signature-policy") + } } // imagePull is implement the command for pulling images. diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go index a13976612..cf787a71f 100644 --- a/cmd/podman/images/push.go +++ b/cmd/podman/images/push.go @@ -101,7 +101,6 @@ func pushFlags(cmd *cobra.Command) { flags.BoolVarP(&pushOptions.Quiet, "quiet", "q", false, "Suppress output information when pushing images") flags.BoolVar(&pushOptions.RemoveSignatures, "remove-signatures", false, "Discard any pre-existing signatures in the image") - flags.StringVar(&pushOptions.SignaturePolicy, "signature-policy", "", "Path to a signature-policy file") signByFlagName := "sign-by" flags.StringVar(&pushOptions.SignBy, signByFlagName, "", "Add a signature at the destination using the specified key") @@ -117,7 +116,10 @@ func pushFlags(cmd *cobra.Command) { _ = flags.MarkHidden("remove-signatures") _ = flags.MarkHidden("sign-by") } - _ = flags.MarkHidden("signature-policy") + if !registry.IsRemote() { + flags.StringVar(&pushOptions.SignaturePolicy, "signature-policy", "", "Path to a signature-policy file") + _ = flags.MarkHidden("signature-policy") + } } // imagePush is implement the command for pushing images. |