diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-12 12:40:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 12:40:51 -0700 |
commit | 15723671b3edefd3cac150dc86323aa1f701ef8d (patch) | |
tree | 38a9abc521ad867f75bba810a0fae94a55ab28b8 | |
parent | 89ffcf9df9d83bc8e0ea7c8004591fb0825117cf (diff) | |
parent | fcea6fda82cc3809f8990c0c80a52f6c4a03c5cd (diff) | |
download | podman-15723671b3edefd3cac150dc86323aa1f701ef8d.tar.gz podman-15723671b3edefd3cac150dc86323aa1f701ef8d.tar.bz2 podman-15723671b3edefd3cac150dc86323aa1f701ef8d.zip |
Merge pull request #2911 from giuseppe/fix-pull-errors
pull: fix a couple of issues
-rw-r--r-- | cmd/podman/pull.go | 9 | ||||
-rw-r--r-- | test/e2e/pull_test.go | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go index 491d3a8c2..7cc7b65b3 100644 --- a/cmd/podman/pull.go +++ b/cmd/podman/pull.go @@ -61,7 +61,12 @@ 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) error { +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() @@ -163,7 +168,7 @@ func pullCmd(c *cliconfig.PullValues) error { for _, name := range names { newImage, err := runtime.New(getContext(), name, c.String("signature-policy"), authfile, writer, &dockerRegistryOptions, image.SigningOptions{}, true, nil) if err != nil { - println(errors.Wrapf(err, "error pulling image %q", name)) + logrus.Errorf("error pulling image %q", name) foundImage = false continue } 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() |