mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
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>
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
// imageParts describes the parts of an image's name
|
// imageParts describes the parts of an image's name
|
||||||
type imageParts struct {
|
type imageParts struct {
|
||||||
|
unnormalizedRef reference.Named // WARNING: Did not go through docker.io[/library] normalization
|
||||||
transport string
|
transport string
|
||||||
registry string
|
registry string
|
||||||
name string
|
name string
|
||||||
@ -45,6 +46,7 @@ func decompose(input string) (imageParts, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return parts, err
|
return parts, err
|
||||||
}
|
}
|
||||||
|
unnormalizedNamed := imgRef.(reference.Named)
|
||||||
ntag, isTagged := imgRef.(reference.NamedTagged)
|
ntag, isTagged := imgRef.(reference.NamedTagged)
|
||||||
if !isTagged {
|
if !isTagged {
|
||||||
tag = "latest"
|
tag = "latest"
|
||||||
@ -54,8 +56,8 @@ func decompose(input string) (imageParts, error) {
|
|||||||
} else {
|
} else {
|
||||||
tag = ntag.Tag()
|
tag = ntag.Tag()
|
||||||
}
|
}
|
||||||
registry := reference.Domain(imgRef.(reference.Named))
|
registry := reference.Domain(unnormalizedNamed)
|
||||||
imageName := reference.Path(imgRef.(reference.Named))
|
imageName := reference.Path(unnormalizedNamed)
|
||||||
// Is this a registry or a repo?
|
// Is this a registry or a repo?
|
||||||
if isRegistry(registry) {
|
if isRegistry(registry) {
|
||||||
hasRegistry = true
|
hasRegistry = true
|
||||||
@ -66,6 +68,7 @@ func decompose(input string) (imageParts, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return imageParts{
|
return imageParts{
|
||||||
|
unnormalizedRef: unnormalizedNamed,
|
||||||
registry: registry,
|
registry: registry,
|
||||||
hasRegistry: hasRegistry,
|
hasRegistry: hasRegistry,
|
||||||
name: imageName,
|
name: imageName,
|
||||||
|
Reference in New Issue
Block a user