summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2019-01-09 21:38:49 +0100
committerMiloslav Trmač <mitr@redhat.com>2019-01-14 04:07:23 +0100
commitb9c0f2c987688a8e7ee2c8f4e4fbf6b1a8fee024 (patch)
treeadbf725a76e1c87db1b75a89e86fc6725b0f8913 /libpod/image/image.go
parente060a19c8768c9dd65d1b8dcbd6da7ec9faa1163 (diff)
downloadpodman-b9c0f2c987688a8e7ee2c8f4e4fbf6b1a8fee024.tar.gz
podman-b9c0f2c987688a8e7ee2c8f4e4fbf6b1a8fee024.tar.bz2
podman-b9c0f2c987688a8e7ee2c8f4e4fbf6b1a8fee024.zip
Use reference.TagNameOnly instead of manually adding imageParts.tag in normalizeTag
Again, rely on the official API, instead of the suprising "suspiciousTagValueForSearch" value (set to :latest on untagged images, and :none on digested ones!) CHANGES BEHAVIOR, but the previous output of normalization of digested values was not even syntatically valid, so this can't really be worse. Still, maybe we should refuse to tag with digested references in the first place. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index 2457a1c22..0b743e144 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -471,12 +471,9 @@ func normalizeTag(tag string) (string, error) {
return "", err
}
}
- tag = ref.String()
// If the input does not have a tag, we need to add one (latest)
- if !decomposedTag.isTagged {
- tag = fmt.Sprintf("%s:%s", tag, decomposedTag.tag)
- }
- return tag, nil
+ ref = reference.TagNameOnly(ref)
+ return ref.String(), nil
}
// TagImage adds a tag to the given image