mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #2911 from giuseppe/fix-pull-errors
pull: fix a couple of issues
This commit is contained in:
@ -61,7 +61,12 @@ func init() {
|
|||||||
|
|
||||||
// pullCmd gets the data from the command line and calls pullImage
|
// pullCmd gets the data from the command line and calls pullImage
|
||||||
// to copy an image from a registry to a local machine
|
// 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") {
|
if c.Bool("trace") {
|
||||||
span, _ := opentracing.StartSpanFromContext(Ctx, "pullCmd")
|
span, _ := opentracing.StartSpanFromContext(Ctx, "pullCmd")
|
||||||
defer span.Finish()
|
defer span.Finish()
|
||||||
@ -163,7 +168,7 @@ func pullCmd(c *cliconfig.PullValues) error {
|
|||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
newImage, err := runtime.New(getContext(), name, c.String("signature-policy"), authfile, writer, &dockerRegistryOptions, image.SigningOptions{}, true, nil)
|
newImage, err := runtime.New(getContext(), name, c.String("signature-policy"), authfile, writer, &dockerRegistryOptions, image.SigningOptions{}, true, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
println(errors.Wrapf(err, "error pulling image %q", name))
|
logrus.Errorf("error pulling image %q", name)
|
||||||
foundImage = false
|
foundImage = false
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -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() {
|
It("podman pull from docker with tag", func() {
|
||||||
session := podmanTest.Podman([]string{"pull", "busybox:glibc"})
|
session := podmanTest.Podman([]string{"pull", "busybox:glibc"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
Reference in New Issue
Block a user