From fcea6fda82cc3809f8990c0c80a52f6c4a03c5cd Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 12 Apr 2019 14:26:39 +0200 Subject: pull: exit with error if the image is not found Closes: https://github.com/containers/libpod/issues/2785 Signed-off-by: Giuseppe Scrivano --- cmd/podman/pull.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cmd/podman/pull.go') diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go index aa000fc52..7cc7b65b3 100644 --- a/cmd/podman/pull.go +++ b/cmd/podman/pull.go @@ -62,6 +62,11 @@ func init() { // pullCmd gets the data from the command line and calls pullImage // to copy an image from a registry to a local machine func pullCmd(c *cliconfig.PullValues) (retError error) { + defer func() { + if retError != nil && exitCode == 0 { + exitCode = 1 + } + }() if c.Bool("trace") { span, _ := opentracing.StartSpanFromContext(Ctx, "pullCmd") defer span.Finish() -- cgit v1.2.3-54-g00ecf