aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-02-16 06:44:45 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-02-22 15:08:58 -0500
commit6f7a803d06e1fe5e760fcd87959f3290b7c460d2 (patch)
treec632ab7fbd856cde677657030567e936d5440e70 /cmd/podman/images
parentd3903a85910979d8212028cf814574047015db58 (diff)
downloadpodman-6f7a803d06e1fe5e760fcd87959f3290b7c460d2.tar.gz
podman-6f7a803d06e1fe5e760fcd87959f3290b7c460d2.tar.bz2
podman-6f7a803d06e1fe5e760fcd87959f3290b7c460d2.zip
Cleanup display of trust with transports
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/trust_show.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/cmd/podman/images/trust_show.go b/cmd/podman/images/trust_show.go
index bcb60e2b3..40c077d67 100644
--- a/cmd/podman/images/trust_show.go
+++ b/cmd/podman/images/trust_show.go
@@ -12,6 +12,7 @@ import (
)
var (
+ noHeading bool
showTrustDescription = "Display trust policy for the system"
showTrustCommand = &cobra.Command{
Annotations: map[string]string{registry.EngineMode: registry.ABIMode},
@@ -40,6 +41,7 @@ func init() {
showFlags.BoolVar(&showTrustOptions.Raw, "raw", false, "Output raw policy file")
_ = showFlags.MarkHidden("policypath")
showFlags.StringVar(&showTrustOptions.RegistryPath, "registrypath", "", "")
+ showFlags.BoolVarP(&noHeading, "noheading", "n", false, "Do not print column headings")
_ = showFlags.MarkHidden("registrypath")
}
@@ -64,10 +66,22 @@ func showTrust(cmd *cobra.Command, args []string) error {
rpt := report.New(os.Stdout, cmd.Name())
defer rpt.Flush()
+ hdrs := report.Headers(imageReporter{}, map[string]string{
+ "Transport": "Transport",
+ "RepoName": "Name",
+ "Type": "Type",
+ "GPGId": "Id",
+ "SignatureStore": "Store",
+ })
rpt, err = rpt.Parse(report.OriginPodman,
- "{{range . }}{{.RepoName}}\t{{.Type}}\t{{.GPGId}}\t{{.SignatureStore}}\n{{end -}}")
+ "{{range . }}{{.Transport}}\t{{.RepoName}}\t{{.Type}}\t{{.GPGId}}\t{{.SignatureStore}}\n{{end -}}")
if err != nil {
return err
}
+ if !noHeading {
+ if err := rpt.Execute(hdrs); err != nil {
+ return err
+ }
+ }
return rpt.Execute(trust.Policies)
}