summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-04-19 08:19:14 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-26 11:17:47 +0000
commitcc03743c0fd9d698a58e52d59cc7d9b0396b8e74 (patch)
treeb54a0305f56f10b8d4c4ab39a734cef3a72f1129 /libpod/image/image.go
parent5973841f5286ca0e15b8d163b99cc5e9783fee3b (diff)
downloadpodman-cc03743c0fd9d698a58e52d59cc7d9b0396b8e74.tar.gz
podman-cc03743c0fd9d698a58e52d59cc7d9b0396b8e74.tar.bz2
podman-cc03743c0fd9d698a58e52d59cc7d9b0396b8e74.zip
Strip transport from image name when looking for local image
When a user pulls an image using a transport, like docker-daemon, we try to lookup the new image in storage by the input name after the pull. Because the input name has a transport (different than local storage), that lookup would fail. Signed-off-by: baude <bbaude@redhat.com> Closes: #644 Approved by: rhatdan
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index c9f03ebef..4d481c8e5 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -183,6 +183,12 @@ func (i *Image) getLocalImage() (*storage.Image, error) {
if i.InputName == "" {
return nil, errors.Errorf("input name is blank")
}
+ // Check if the input name has a transport and if so strip it
+ dest, err := alltransports.ParseImageName(i.InputName)
+ if err == nil && dest.DockerReference() != nil {
+ i.InputName = dest.DockerReference().String()
+ }
+
var taggedName string
img, err := i.imageruntime.getImage(stripSha256(i.InputName))
if err == nil {