summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/pull.go5
-rw-r--r--test/e2e/pull_test.go6
2 files changed, 11 insertions, 0 deletions
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()
diff --git a/test/e2e/pull_test.go b/test/e2e/pull_test.go
index de6d4ea09..4e4e80d56 100644
--- a/test/e2e/pull_test.go
+++ b/test/e2e/pull_test.go
@@ -38,6 +38,12 @@ var _ = Describe("Podman pull", func() {
})
+ It("podman pull from docker a not existing image", func() {
+ session := podmanTest.Podman([]string{"pull", "ibetthisdoesntexistthere:foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Not(Equal(0)))
+ })
+
It("podman pull from docker with tag", func() {
session := podmanTest.Podman([]string{"pull", "busybox:glibc"})
session.WaitWithDefaultTimeout()