summaryrefslogtreecommitdiff
path: root/cmd/podman/inspect/inspect.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2021-11-18 09:03:00 -0700
committerJhon Honce <jhonce@redhat.com>2021-12-02 09:07:27 -0700
commit61792de36ea2ea98f6e3aef3821d1b15beebf9e0 (patch)
treef2e73122b2cdb0323e1d38792eef44a625b85d10 /cmd/podman/inspect/inspect.go
parentfbcebcb46a2444ce078dee10d8d51555bee8f177 (diff)
downloadpodman-61792de36ea2ea98f6e3aef3821d1b15beebf9e0.tar.gz
podman-61792de36ea2ea98f6e3aef3821d1b15beebf9e0.tar.bz2
podman-61792de36ea2ea98f6e3aef3821d1b15beebf9e0.zip
Refactor podman image command output
Leverage new report.Formatter allowing better compatibility from podman command output. Follow on PR's will cover containers, etc. See #10974 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/inspect/inspect.go')
-rw-r--r--cmd/podman/inspect/inspect.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/podman/inspect/inspect.go b/cmd/podman/inspect/inspect.go
index 64b586388..c982b1b7f 100644
--- a/cmd/podman/inspect/inspect.go
+++ b/cmd/podman/inspect/inspect.go
@@ -215,8 +215,10 @@ func (i *inspector) inspect(namesOrIDs []string) error {
case report.IsJSON(i.options.Format) || i.options.Format == "":
err = printJSON(data)
default:
+ // Landing here implies user has given a custom --format
row := inspectNormalize(i.options.Format)
- row = "{{range . }}" + report.NormalizeFormat(row) + "{{end -}}"
+ row = report.NormalizeFormat(row)
+ row = report.EnforceRange(row)
err = printTmpl(tmpType, row, data)
}
if err != nil {