From 32c77af6ac94ba4e34fc9aaa784c6ca69c114cf0 Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 9 Jul 2020 10:43:10 -0400 Subject: [PATCH] Clarify repo name regex intention Add context to comment to explain the repo name regex in addition to describing it. Signed-off-by: David Warshaw --- reference/regexp.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/regexp.go b/reference/regexp.go index 78603493..78e2f917 100644 --- a/reference/regexp.go +++ b/reference/regexp.go @@ -9,7 +9,11 @@ var ( // separatorRegexp defines the separators allowed to be embedded in name // components. This allow one period, one or two underscore and multiple - // dashes. + // dashes. Repeated dashes and underscores are intentionally treated + // differently. In order to support valid hostnames as name components, + // supporting repeated dash was added. Additionally double underscore is + // now allowed as a separator to loosen the restriction for previously + // supported names. separatorRegexp = match(`(?:[._]|__|[-]*)`) // nameComponentRegexp restricts registry path component names to start