summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-14 12:33:11 -0700
committerGitHub <noreply@github.com>2020-05-14 12:33:11 -0700
commit32268eaa6239057b82445172bf8128dabec0fe14 (patch)
tree3011e41d01635cc83ad7cd38c5cb1cbc60b2af48 /cmd/podman
parent77dbfc753097d4b3a07c1382cb388e79515ffdb0 (diff)
parent28ffe74e4441d96cb36abb58344824bfc4701c47 (diff)
downloadpodman-32268eaa6239057b82445172bf8128dabec0fe14.tar.gz
podman-32268eaa6239057b82445172bf8128dabec0fe14.tar.bz2
podman-32268eaa6239057b82445172bf8128dabec0fe14.zip
Merge pull request #6235 from QiWang19/events-format
fix bug --format {{json.}} of events
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/system/events.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/system/events.go b/cmd/podman/system/events.go
index 6aae62dc0..27e80138e 100644
--- a/cmd/podman/system/events.go
+++ b/cmd/podman/system/events.go
@@ -5,6 +5,7 @@ import (
"context"
"html/template"
"os"
+ "strings"
"github.com/containers/buildah/pkg/formats"
"github.com/containers/libpod/cmd/podman/registry"
@@ -54,6 +55,9 @@ func eventsCmd(cmd *cobra.Command, args []string) error {
eventsError error
tmpl *template.Template
)
+ if strings.Join(strings.Fields(eventFormat), "") == "{{json.}}" {
+ eventFormat = formats.JSONString
+ }
if eventFormat != formats.JSONString {
tmpl, err = template.New("events").Parse(eventFormat)
if err != nil {