Skip to content

Commit

Permalink
Merge pull request containers#22643 from qianxi0410/duplicate-isremote
Browse files Browse the repository at this point in the history
Remove duplicate `IsRemote`  call
  • Loading branch information
openshift-merge-bot[bot] authored May 30, 2024
2 parents 939cb83 + 6c78a72 commit 8b15ec9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions cmd/podman/images/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,14 @@ func pullFlags(cmd *cobra.Command) {

if registry.IsRemote() {
_ = flags.MarkHidden(decryptionKeysFlagName)
}
if !registry.IsRemote() {
} else {
certDirFlagName := "cert-dir"
flags.StringVar(&pullOptions.CertDir, certDirFlagName, "", "`Pathname` of a directory containing TLS certificates and keys")
_ = cmd.RegisterFlagCompletionFunc(certDirFlagName, completion.AutocompleteDefault)
}
if !registry.IsRemote() {
flags.StringVar(&pullOptions.SignaturePolicy, "signature-policy", "", "`Pathname` of signature policy file (not usually used)")
_ = flags.MarkHidden("signature-policy")

signaturePolicyFlagName := "signature-policy"
flags.StringVar(&pullOptions.SignaturePolicy, signaturePolicyFlagName, "", "`Pathname` of signature policy file (not usually used)")
_ = flags.MarkHidden(signaturePolicyFlagName)
}
}

Expand Down
10 changes: 5 additions & 5 deletions cmd/podman/images/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ func pushFlags(cmd *cobra.Command) {
_ = flags.MarkHidden(signPassphraseFileFlagName)
_ = flags.MarkHidden(encryptionKeysFlagName)
_ = flags.MarkHidden(encryptLayersFlagName)
}
if !registry.IsRemote() {
flags.StringVar(&pushOptions.SignaturePolicy, "signature-policy", "", "Path to a signature-policy file")
_ = flags.MarkHidden("signature-policy")
} else {
signaturePolicyFlagName := "signature-policy"
flags.StringVar(&pushOptions.SignaturePolicy, signaturePolicyFlagName, "", "Path to a signature-policy file")
_ = flags.MarkHidden(signaturePolicyFlagName)
}
}

Expand Down Expand Up @@ -257,7 +257,7 @@ func imagePush(cmd *cobra.Command, args []string) error {
}

if pushOptions.DigestFile != "" {
if err := os.WriteFile(pushOptions.DigestFile, []byte(report.ManifestDigest), 0644); err != nil {
if err := os.WriteFile(pushOptions.DigestFile, []byte(report.ManifestDigest), 0o644); err != nil {
return err
}
}
Expand Down

0 comments on commit 8b15ec9

Please sign in to comment.