diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-23 00:46:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 00:46:51 -0500 |
commit | ccb96a2791fe9ae58a697bf1715600ecec8b246b (patch) | |
tree | 92add99773bfc2f3d68c550e09a46a177d7789b2 /cmd | |
parent | bc0e084f2d909eeeacbe17938cb1ef8dbc90f7a2 (diff) | |
parent | 6f7a803d06e1fe5e760fcd87959f3290b7c460d2 (diff) | |
download | podman-ccb96a2791fe9ae58a697bf1715600ecec8b246b.tar.gz podman-ccb96a2791fe9ae58a697bf1715600ecec8b246b.tar.bz2 podman-ccb96a2791fe9ae58a697bf1715600ecec8b246b.zip |
Merge pull request #13247 from rhatdan/trust
Cleanup display of trust with transports
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/images/trust_show.go | 16 |
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) } |