Reorganize normalizeTag

Move the registry defaulting before tag defaulting.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2019-01-09 19:49:53 +01:00
parent 788bc36021
commit 035c732ded

View File

@ -458,14 +458,14 @@ func normalizeTag(tag string) (string, error) {
if err != nil {
return "", err
}
// 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)
}
// If the input doesn't specify a registry, set the registry to localhost
if !decomposedTag.hasRegistry {
tag = fmt.Sprintf("%s/%s", DefaultLocalRegistry, tag)
}
// 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
}