summaryrefslogtreecommitdiff
path: root/libpod/image/pull_test.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2019-01-09 20:02:54 +0100
committerMiloslav Trmač <mitr@redhat.com>2019-01-14 04:07:23 +0100
commitae2a95196e9e5a3519b396105d01a3661de330ba (patch)
tree76b38edb5dc2cf1bd7e82e368ff2214e27348fba /libpod/image/pull_test.go
parent035c732dedf37637b9ac5e37748ec1b0bea3c966 (diff)
downloadpodman-ae2a95196e9e5a3519b396105d01a3661de330ba.tar.gz
podman-ae2a95196e9e5a3519b396105d01a3661de330ba.tar.bz2
podman-ae2a95196e9e5a3519b396105d01a3661de330ba.zip
Don't use imageParts.assemble when pulling from a qualified name
CHANGES BEHAVIOR. If the name is qualified, instead of decomposing it into components and re-assembling, just use the input name unmodified: - For name:tag values, .assemble() just recreates the input. - For untagged values, .assemble() adds ":latest"; we keep the input as is, but both docker.ParseReference and storage.Transport.ParseStoreReference use reference.TagNameOnly() already. - For digested references, .assemble() adds ":none", but the code was already bypassing .assemble() on that path already - for the source reference. For the destination, this replaces a :none destination with a the @digest reference, as expected. Note that while decompose() has already parsed the input, it (intentionally) bypassed the docker.io/library normalization; therefore we parse the input again (via docker.ParseReference) to ensure that the reference is normalized. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'libpod/image/pull_test.go')
-rw-r--r--libpod/image/pull_test.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/libpod/image/pull_test.go b/libpod/image/pull_test.go
index 37b45dc83..4a0119070 100644
--- a/libpod/image/pull_test.go
+++ b/libpod/image/pull_test.go
@@ -324,8 +324,7 @@ func TestPullGoalFromPossiblyUnqualifiedName(t *testing.T) {
{ // Qualified example.com, name@digest.
"example.com/ns/busybox" + digestSuffix,
[]pullRefStrings{{"example.com/ns/busybox" + digestSuffix, "docker://example.com/ns/busybox" + digestSuffix,
- // FIXME?! Why is .dstName dropping the digest, and adding :none?!
- "example.com/ns/busybox:none"}},
+ "example.com/ns/busybox" + digestSuffix}},
false,
},
// Qualified example.com, name:tag@digest. This code is happy to try, but .srcRef parsing currently rejects such input.