aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-11-08 23:16:03 +0100
committerGitHub <noreply@github.com>2019-11-08 23:16:03 +0100
commitb713e5371fa8767067bd2c329a3744ea593b2ade (patch)
tree9fec27ec1ebc354f3c2eafa7b8a860260abf60fd /cmd
parentf456ce90f966f2eefdfc27ca83541ceacc4a298d (diff)
parentcb2978d6e93b5ad19478386484ba57610d6cfa67 (diff)
downloadpodman-b713e5371fa8767067bd2c329a3744ea593b2ade.tar.gz
podman-b713e5371fa8767067bd2c329a3744ea593b2ade.tar.bz2
podman-b713e5371fa8767067bd2c329a3744ea593b2ade.zip
Merge pull request #4408 from slimjim2234/master
Fixed issue #4391; podman info --format '{{ json . }}'
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/info.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/info.go b/cmd/podman/info.go
index bf6dd4a8f..7361525ce 100644
--- a/cmd/podman/info.go
+++ b/cmd/podman/info.go
@@ -3,6 +3,7 @@ package main
import (
"fmt"
rt "runtime"
+ "strings"
"github.com/containers/buildah/pkg/formats"
"github.com/containers/libpod/cmd/podman/cliconfig"
@@ -88,6 +89,9 @@ func infoCmd(c *cliconfig.InfoValues) error {
var out formats.Writer
infoOutputFormat := c.Format
+ if strings.Join(strings.Fields(infoOutputFormat), "") == "{{json.}}" {
+ infoOutputFormat = formats.JSONString
+ }
switch infoOutputFormat {
case formats.JSONString:
out = formats.JSONStruct{Output: info}