diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-11 13:13:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-11 13:13:31 +0200 |
commit | 1dc0a335fb894af7006cba4dbf67a6ed975ef7ed (patch) | |
tree | 791e9f60ae8272e6fec063e45f5e7039e2057d3b /cmd/podman/system/version.go | |
parent | 1d7175314c350b61b84ca4b2237d662e9b3f6c09 (diff) | |
parent | bb9d939155c2ce37654abd58a71f650bde6bce50 (diff) | |
download | podman-1dc0a335fb894af7006cba4dbf67a6ed975ef7ed.tar.gz podman-1dc0a335fb894af7006cba4dbf67a6ed975ef7ed.tar.bz2 podman-1dc0a335fb894af7006cba4dbf67a6ed975ef7ed.zip |
Merge pull request #6929 from vrothberg/fix-9627
version/info: format: allow more json variants
Diffstat (limited to 'cmd/podman/system/version.go')
-rw-r--r-- | cmd/podman/system/version.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/system/version.go b/cmd/podman/system/version.go index 5aac34699..9b70bc9f4 100644 --- a/cmd/podman/system/version.go +++ b/cmd/podman/system/version.go @@ -8,6 +8,7 @@ import ( "text/tabwriter" "github.com/containers/buildah/pkg/formats" + "github.com/containers/libpod/v2/cmd/podman/parse" "github.com/containers/libpod/v2/cmd/podman/registry" "github.com/containers/libpod/v2/cmd/podman/validate" "github.com/containers/libpod/v2/libpod/define" @@ -41,7 +42,7 @@ func version(cmd *cobra.Command, args []string) error { } switch { - case versionFormat == "json", versionFormat == "{{ json .}}": + case parse.MatchesJSONFormat(versionFormat): s, err := json.MarshalToString(versions) if err != nil { return err |