summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2019-01-09 21:50:40 +0100
committerMiloslav Trmač <mitr@redhat.com>2019-01-14 04:07:23 +0100
commitcf40b7161476414e7abecd19d9d9eefacd8a4ef7 (patch)
tree40063576f028127ad4f3589ecd73213e1bb264d0
parentd559365d7aea4f9957e3efb869480aaeb33b9ec6 (diff)
downloadpodman-cf40b7161476414e7abecd19d9d9eefacd8a4ef7.tar.gz
podman-cf40b7161476414e7abecd19d9d9eefacd8a4ef7.tar.bz2
podman-cf40b7161476414e7abecd19d9d9eefacd8a4ef7.zip
Use imageParts.referenceWithRegistry in Image.getLocalImage
... to make sure everything uses the same code path. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r--libpod/image/image.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index 899b8792f..381c28fac 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -243,12 +243,14 @@ func (i *Image) getLocalImage() (*storage.Image, error) {
// with a tag. It cannot be local.
if decomposedImage.hasRegistry {
return nil, errors.Wrapf(ErrNoSuchImage, imageError)
-
}
-
// if the image is saved with the repository localhost, searching with localhost prepended is necessary
// We don't need to strip the sha because we have already determined it is not an ID
- img, err = i.imageruntime.getImage(fmt.Sprintf("%s/%s", DefaultLocalRegistry, i.InputName))
+ ref, err := decomposedImage.referenceWithRegistry(DefaultLocalRegistry)
+ if err != nil {
+ return nil, err
+ }
+ img, err = i.imageruntime.getImage(ref.String())
if err == nil {
return img.image, err
}