mirror of
https://github.com/containers/podman.git
synced 2025-08-01 16:24:58 +08:00
Clarify comments about isRegistry a bit.
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@ -17,7 +17,8 @@ type imageParts struct {
|
|||||||
hasRegistry bool
|
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 {
|
func isRegistry(name string) bool {
|
||||||
return strings.ContainsAny(name, ".:") || name == "localhost"
|
return strings.ContainsAny(name, ".:") || name == "localhost"
|
||||||
}
|
}
|
||||||
@ -57,7 +58,9 @@ func decompose(input string) (imageParts, error) {
|
|||||||
}
|
}
|
||||||
registry := reference.Domain(unnormalizedNamed)
|
registry := reference.Domain(unnormalizedNamed)
|
||||||
imageName := reference.Path(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) {
|
if isRegistry(registry) {
|
||||||
hasRegistry = true
|
hasRegistry = true
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user