summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/util/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/util/util.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/util/util.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/vendor/github.com/projectatomic/buildah/util/util.go b/vendor/github.com/projectatomic/buildah/util/util.go
index 41bd46cb3..e8539f978 100644
--- a/vendor/github.com/projectatomic/buildah/util/util.go
+++ b/vendor/github.com/projectatomic/buildah/util/util.go
@@ -70,7 +70,7 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
}
}
- // If the image is from a different transport
+ // If the image includes a transport's name as a prefix, use it as-is.
split := strings.SplitN(name, ":", 2)
if len(split) == 2 {
if _, ok := Transports[split[0]]; ok {
@@ -91,8 +91,16 @@ func ResolveName(name string, firstRegistry string, sc *types.SystemContext, sto
// If this domain can cause us to insert something in the middle, check if that happened.
repoPath := reference.Path(named)
domain := reference.Domain(named)
+ tag := ""
+ if tagged, ok := named.(reference.Tagged); ok {
+ tag = ":" + tagged.Tag()
+ }
+ digest := ""
+ if digested, ok := named.(reference.Digested); ok {
+ digest = "@" + digested.Digest().String()
+ }
defaultPrefix := RegistryDefaultPathPrefix[reference.Domain(named)] + "/"
- if strings.HasPrefix(repoPath, defaultPrefix) && path.Join(domain, repoPath[len(defaultPrefix):]) == name {
+ if strings.HasPrefix(repoPath, defaultPrefix) && path.Join(domain, repoPath[len(defaultPrefix):])+tag+digest == name {
// Yup, parsing just inserted a bit in the middle, so there was a domain name there to begin with.
return []string{name}
}