summaryrefslogtreecommitdiff
path: root/cmd/podman/inspect.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-01-18 14:30:45 +0100
committerValentin Rothberg <rothberg@redhat.com>2019-01-18 14:30:45 +0100
commitf1c5b1e912ab380ca9e7c2adea39c0c5e974794d (patch)
tree1bef6c081b7a772689cd7af1be18138d383c264e /cmd/podman/inspect.go
parente3dc6609d05695e649e76d4505e4761cafebcef6 (diff)
downloadpodman-f1c5b1e912ab380ca9e7c2adea39c0c5e974794d.tar.gz
podman-f1c5b1e912ab380ca9e7c2adea39c0c5e974794d.tar.bz2
podman-f1c5b1e912ab380ca9e7c2adea39c0c5e974794d.zip
podman-inspect: don't ignore errors
Return errors when executing the --format templates. Otherwise, Podman will just silently ignore them and not print any output that could guide user into solving the issue. Fixes: #2159 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/inspect.go')
-rw-r--r--cmd/podman/inspect.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/podman/inspect.go b/cmd/podman/inspect.go
index 6ffcde55f..2f1e97c6c 100644
--- a/cmd/podman/inspect.go
+++ b/cmd/podman/inspect.go
@@ -87,6 +87,9 @@ func inspectCmd(c *cli.Context) error {
}
inspectedObjects, iterateErr := iterateInput(getContext(), c, args, runtime, inspectType)
+ if iterateErr != nil {
+ return iterateErr
+ }
var out formats.Writer
if outputFormat != "" && outputFormat != formats.JSONString {
@@ -97,8 +100,7 @@ func inspectCmd(c *cli.Context) error {
out = formats.JSONStructArray{Output: inspectedObjects}
}
- formats.Writer(out).Out()
- return iterateErr
+ return formats.Writer(out).Out()
}
// func iterateInput iterates the images|containers the user has requested and returns the inspect data and error