Use imageparts.referenceWithRegistry in normalizeTag

... instead of open-coding something similar.  Eventually
we will use the reference type further in here.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2019-01-09 21:18:53 +01:00
parent e5c764ec3c
commit e58aa74766
1 changed files with 5 additions and 1 deletions

View File

@ -460,7 +460,11 @@ func normalizeTag(tag string) (string, error) {
}
// If the input doesn't specify a registry, set the registry to localhost
if !decomposedTag.hasRegistry {
tag = fmt.Sprintf("%s/%s", DefaultLocalRegistry, tag)
ref, err := decomposedTag.referenceWithRegistry(DefaultLocalRegistry)
if err != nil {
return "", err
}
tag = ref.String()
}
// If the input does not have a tag, we need to add one (latest)
if !decomposedTag.isTagged {