diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-06-25 00:20:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-25 00:20:25 +0200 |
commit | d8b18a98791a49f5352d6a849cef7bff136cbb2c (patch) | |
tree | 21fc7842615b30a5c6bc9cd031a7476b7a3ef313 /cmd | |
parent | 394e12aa656ed3d9cc0afef48f1315fff5ed5db3 (diff) | |
parent | 2d9f1e95eb00242751ff0d9655bb513c27173475 (diff) | |
download | podman-d8b18a98791a49f5352d6a849cef7bff136cbb2c.tar.gz podman-d8b18a98791a49f5352d6a849cef7bff136cbb2c.tar.bz2 podman-d8b18a98791a49f5352d6a849cef7bff136cbb2c.zip |
Merge pull request #3401 from mheon/templating_is_dumb
Fix inspect --format '{{.Mounts}}.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/inspect.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/inspect.go b/cmd/podman/inspect.go index 4303c149c..24edfcb68 100644 --- a/cmd/podman/inspect.go +++ b/cmd/podman/inspect.go @@ -98,6 +98,14 @@ func inspectCmd(c *cliconfig.InspectValues) error { if strings.Contains(outputFormat, "{{.Id}}") { outputFormat = strings.Replace(outputFormat, "{{.Id}}", formats.IDString, -1) } + // These fields were renamed, so we need to provide backward compat for + // the old names. + if strings.Contains(outputFormat, ".Src") { + outputFormat = strings.Replace(outputFormat, ".Src", ".Source", -1) + } + if strings.Contains(outputFormat, ".Dst") { + outputFormat = strings.Replace(outputFormat, ".Dst", ".Destination", -1) + } if latestContainer { lc, err := runtime.GetLatestContainer() if err != nil { |