From 797d194050d4b7b78d255d19f4099463dc048425 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Wed, 9 Jan 2019 22:18:25 +0100 Subject: Clarify comments about isRegistry a bit. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Should not change behavior. Signed-off-by: Miloslav Trmač --- libpod/image/parts.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libpod/image/parts.go b/libpod/image/parts.go index b5b05c32d..62cca2757 100644 --- a/libpod/image/parts.go +++ b/libpod/image/parts.go @@ -17,7 +17,8 @@ type imageParts struct { hasRegistry bool } -// Registries must contain a ":" or a "." or be localhost +// Registries must contain a ":" or a "." or be localhost; this helper exists for users of reference.Parse. +// For inputs that should use the docker.io[/library] normalization, use reference.ParseNormalizedNamed instead. func isRegistry(name string) bool { return strings.ContainsAny(name, ".:") || name == "localhost" } @@ -57,7 +58,9 @@ func decompose(input string) (imageParts, error) { } registry := reference.Domain(unnormalizedNamed) imageName := reference.Path(unnormalizedNamed) - // Is this a registry or a repo? + // ip.unnormalizedRef, because it uses reference.Parse and not reference.ParseNormalizedNamed, + // does not use the standard heuristics for domains vs. namespaces/repos, so we need to check + // explicitly. if isRegistry(registry) { hasRegistry = true } else { -- cgit v1.2.3-54-g00ecf