summaryrefslogtreecommitdiff
path: root/cmd/podman/pull.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-02-15 10:33:18 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-15 17:18:08 +0000
commit409ed259c6b3ea9122c697e9e20b4b1572f485d1 (patch)
tree61c2c2107799eb542beb9f294796510bf1803578 /cmd/podman/pull.go
parentce7a0171d156709bc8bbf2ac1138b8022bb08054 (diff)
downloadpodman-409ed259c6b3ea9122c697e9e20b4b1572f485d1.tar.gz
podman-409ed259c6b3ea9122c697e9e20b4b1572f485d1.tar.bz2
podman-409ed259c6b3ea9122c697e9e20b4b1572f485d1.zip
Return imageid from podman pull
When using podman to pull an image, print the image id after the image is pulled. Resolves issue #329 Signed-off-by: baude <bbaude@redhat.com> Closes: #342 Approved by: rhatdan
Diffstat (limited to 'cmd/podman/pull.go')
-rw-r--r--cmd/podman/pull.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go
index c19e6715b..886f82dd5 100644
--- a/cmd/podman/pull.go
+++ b/cmd/podman/pull.go
@@ -4,6 +4,7 @@ import (
"io"
"os"
+ "fmt"
"github.com/containers/image/types"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod"
@@ -106,5 +107,13 @@ func pullCmd(c *cli.Context) error {
if _, err := runtime.PullImage(image, options); err != nil {
return errors.Wrapf(err, "error pulling image %q", image)
}
+
+ newImage := runtime.NewImage(image)
+ iid, err := newImage.GetImageID()
+ // Intentially choosing to ignore if there is an error because
+ // outputting the image ID is a NTH and not integral to the pull
+ if err == nil {
+ fmt.Println(iid)
+ }
return nil
}