summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2019-01-09 18:28:28 +0100
committerMiloslav Trmač <mitr@redhat.com>2019-01-14 04:07:22 +0100
commitc19294c0113e4ddea7005bab5d8a31f7ecd6c120 (patch)
tree02efdaca4982a30eabb7577c119f8eb0cccb4616
parent6486e2c41be0aa50bd5b70d859a23f36070d0ae1 (diff)
downloadpodman-c19294c0113e4ddea7005bab5d8a31f7ecd6c120.tar.gz
podman-c19294c0113e4ddea7005bab5d8a31f7ecd6c120.tar.bz2
podman-c19294c0113e4ddea7005bab5d8a31f7ecd6c120.zip
Record the original reference.Named in imageParts
We will eventually want to eliminate most members of imageParts in favor of using the c/image/docker/reference API directly. For now, just record the reference.Named value, and we will replace uses of the other members before removing them. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
-rw-r--r--libpod/image/parts.go31
1 files changed, 17 insertions, 14 deletions
diff --git a/libpod/image/parts.go b/libpod/image/parts.go
index 9adf26fb9..289a02e1f 100644
--- a/libpod/image/parts.go
+++ b/libpod/image/parts.go
@@ -9,12 +9,13 @@ import (
// imageParts describes the parts of an image's name
type imageParts struct {
- transport string
- registry string
- name string
- tag string
- isTagged bool
- hasRegistry bool
+ unnormalizedRef reference.Named // WARNING: Did not go through docker.io[/library] normalization
+ transport string
+ registry string
+ name string
+ tag string
+ isTagged bool
+ hasRegistry bool
}
// Registries must contain a ":" or a "." or be localhost
@@ -45,6 +46,7 @@ func decompose(input string) (imageParts, error) {
if err != nil {
return parts, err
}
+ unnormalizedNamed := imgRef.(reference.Named)
ntag, isTagged := imgRef.(reference.NamedTagged)
if !isTagged {
tag = "latest"
@@ -54,8 +56,8 @@ func decompose(input string) (imageParts, error) {
} else {
tag = ntag.Tag()
}
- registry := reference.Domain(imgRef.(reference.Named))
- imageName := reference.Path(imgRef.(reference.Named))
+ registry := reference.Domain(unnormalizedNamed)
+ imageName := reference.Path(unnormalizedNamed)
// Is this a registry or a repo?
if isRegistry(registry) {
hasRegistry = true
@@ -66,12 +68,13 @@ func decompose(input string) (imageParts, error) {
}
}
return imageParts{
- registry: registry,
- hasRegistry: hasRegistry,
- name: imageName,
- tag: tag,
- isTagged: isTagged,
- transport: DefaultTransport,
+ unnormalizedRef: unnormalizedNamed,
+ registry: registry,
+ hasRegistry: hasRegistry,
+ name: imageName,
+ tag: tag,
+ isTagged: isTagged,
+ transport: DefaultTransport,
}, nil
}