summaryrefslogtreecommitdiff
path: root/cmd/podman/secrets/inspect.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-13 20:26:24 +0200
committerGitHub <noreply@github.com>2022-09-13 20:26:24 +0200
commitad529f31d82796c17c5a3dde5fed20b84d5bd256 (patch)
tree6d6f50a8e9c9d5d9de2b5bb248d3f54b8ee755fe /cmd/podman/secrets/inspect.go
parent6e382d9ec2e6eb79a72537544341e496368b6c63 (diff)
parent9d41b95d72ef29870e6c325557c89c2db818a371 (diff)
downloadpodman-ad529f31d82796c17c5a3dde5fed20b84d5bd256.tar.gz
podman-ad529f31d82796c17c5a3dde5fed20b84d5bd256.tar.bz2
podman-ad529f31d82796c17c5a3dde5fed20b84d5bd256.zip
Merge pull request #15673 from Luap99/template
Fix go template parsing with "\n" in it
Diffstat (limited to 'cmd/podman/secrets/inspect.go')
-rw-r--r--cmd/podman/secrets/inspect.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/cmd/podman/secrets/inspect.go b/cmd/podman/secrets/inspect.go
index c99e555ba..f4c395b0f 100644
--- a/cmd/podman/secrets/inspect.go
+++ b/cmd/podman/secrets/inspect.go
@@ -47,20 +47,15 @@ func inspect(cmd *cobra.Command, args []string) error {
}
if cmd.Flags().Changed("format") {
- row := report.NormalizeFormat(format)
- formatted := report.EnforceRange(row)
+ rpt := report.New(os.Stdout, cmd.Name())
+ defer rpt.Flush()
- tmpl, err := report.NewTemplate("inspect").Parse(formatted)
+ rpt, err := rpt.Parse(report.OriginUser, format)
if err != nil {
return err
}
- w, err := report.NewWriterDefault(os.Stdout)
- if err != nil {
- return err
- }
- defer w.Flush()
- if err := tmpl.Execute(w, inspected); err != nil {
+ if err := rpt.Execute(inspected); err != nil {
return err
}
} else {