diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-30 06:13:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 06:13:51 -0400 |
commit | 117043040e18e473f3b2142576303349238a36a7 (patch) | |
tree | fbb26cab3ae5aefeb7beb896f68289267bc3a478 /cmd/podman/images/list.go | |
parent | c66ce8d67f9eb53a0997da39999ed8629d3252e3 (diff) | |
parent | 9917fc0f956c849ec2d52f3f873aa6eaa3f25e72 (diff) | |
download | podman-117043040e18e473f3b2142576303349238a36a7.tar.gz podman-117043040e18e473f3b2142576303349238a36a7.tar.bz2 podman-117043040e18e473f3b2142576303349238a36a7.zip |
Merge pull request #7146 from rhatdan/format
Don't crash when giving bogus format commands
Diffstat (limited to 'cmd/podman/images/list.go')
-rw-r--r-- | cmd/podman/images/list.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 4552901f7..ee0f64d99 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -168,7 +168,11 @@ func writeTemplate(imgs []imageReporter) error { } } format := hdr + "{{range . }}" + row + "{{end}}" - tmpl := template.Must(template.New("list").Parse(format)) + tmpl, err := template.New("list").Parse(format) + if err != nil { + return err + } + tmpl = template.Must(tmpl, nil) w := tabwriter.NewWriter(os.Stdout, 8, 2, 2, ' ', 0) defer w.Flush() return tmpl.Execute(w, imgs) |