mirror of
https://github.com/containers/podman.git
synced 2025-06-02 02:26:52 +08:00
pull: exit with error if the image is not found
Closes: https://github.com/containers/libpod/issues/2785 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -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()
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user