From 85d39272543310d0dfb5fa949b712049022e6dac Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 23 Sep 2021 14:44:42 -0400 Subject: [PATCH] Remove check for empty location from parseLocation Empty location is now allowed with a valid prefix, and we check for these in postProcessRegistries already. This check doesn't need to exist. Fixes: https://github.com/containers/image/pull/1191#discussion_r610122617 Signed-off-by: Lokesh Mandvekar --- pkg/sysregistriesv2/system_registries_v2.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkg/sysregistriesv2/system_registries_v2.go b/pkg/sysregistriesv2/system_registries_v2.go index 34ca1da39c..2c90ccba23 100644 --- a/pkg/sysregistriesv2/system_registries_v2.go +++ b/pkg/sysregistriesv2/system_registries_v2.go @@ -264,16 +264,6 @@ func (e *InvalidRegistries) Error() string { func parseLocation(input string) (string, error) { trimmed := strings.TrimRight(input, "/") - // FIXME: This check needs to exist but fails for empty Location field with - // wildcarded prefix. Removal of this check "only" allows invalid input in, - // and does not prevent correct operation. - // https://github.com/containers/image/pull/1191#discussion_r610122617 - // - // if trimmed == "" { - // return "", &InvalidRegistries{s: "invalid location: cannot be empty"} - // } - // - if strings.HasPrefix(trimmed, "http://") || strings.HasPrefix(trimmed, "https://") { msg := fmt.Sprintf("invalid location '%s': URI schemes are not supported", input) return "", &InvalidRegistries{s: msg}