summaryrefslogtreecommitdiff
path: root/libpod/image/pull.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2019-01-09 20:43:13 +0100
committerMiloslav Trmač <mitr@redhat.com>2019-01-14 04:07:23 +0100
commit2171a393904051ab724fa08d01a964adbf7c1880 (patch)
tree8fdf09d229fa4cf326e69426c6dcf20fe50f9228 /libpod/image/pull.go
parent72777b7fee22e04edee08034927d5864ffc4bc3e (diff)
downloadpodman-2171a393904051ab724fa08d01a964adbf7c1880.tar.gz
podman-2171a393904051ab724fa08d01a964adbf7c1880.tar.bz2
podman-2171a393904051ab724fa08d01a964adbf7c1880.zip
Use imageParts.referenceWithRegistry in getPullRefPair
CHANGES BEHAVIOR. This bypasses .assemble, and preserves the original lack of tag / original digest instead of adding :latest/:none (still subject to ParseStoreReference normalization). Using the original digest seems clearly correct; dropping the :latest suffix from .image strings only affects user-visible input; later uses of the return value of pullImageFrom... use ParseStoreReference, which calls reference.TagNameOnly, so the image name should be processed the same way whether it contains a tag or not. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'libpod/image/pull.go')
-rw-r--r--libpod/image/pull.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/image/pull.go b/libpod/image/pull.go
index ee5e333e3..70f89ea7d 100644
--- a/libpod/image/pull.go
+++ b/libpod/image/pull.go
@@ -76,9 +76,11 @@ func (ir *Runtime) getPullRefPair(srcRef types.ImageReference, destName string)
decomposedDest, err := decompose(destName)
if err == nil && !decomposedDest.hasRegistry {
// If the image doesn't have a registry, set it as the default repo
- decomposedDest.registry = DefaultLocalRegistry
- decomposedDest.hasRegistry = true
- destName = decomposedDest.assemble()
+ ref, err := decomposedDest.referenceWithRegistry(DefaultLocalRegistry)
+ if err != nil {
+ return pullRefPair{}, err
+ }
+ destName = ref.String()
}
reference := destName