From e58aa74766c14844700330e11e8f0b48843884be Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Wed, 9 Jan 2019 21:18:53 +0100 Subject: Use imageparts.referenceWithRegistry in normalizeTag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... 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č --- libpod/image/image.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libpod/image/image.go b/libpod/image/image.go index 249beceac..3d8cf2651 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -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 { -- cgit v1.2.3-54-g00ecf