diff --git a/pkg/validate/validate.go b/pkg/validate/validate.go index 7e17fdbc308..e05f8cc656b 100644 --- a/pkg/validate/validate.go +++ b/pkg/validate/validate.go @@ -277,9 +277,5 @@ func Host(v string) error { if proxyIP != nil { return nil } - re := regexp.MustCompile("^[a-z]") - if !re.MatchString(v) { - return errors.New("domain name must begin with a lower-case letter") - } return validateSubdomain(v) } diff --git a/pkg/validate/validate_test.go b/pkg/validate/validate_test.go index c45b1a53688..fb0e8f08e43 100644 --- a/pkg/validate/validate_test.go +++ b/pkg/validate/validate_test.go @@ -101,7 +101,7 @@ func TestVCenter(t *testing.T) { {"single lowercase", "a", true}, {"single uppercase", "A", false}, {"contains whitespace", "abc D", false}, - {"single number", "1", false}, + {"single number", "1", true}, {"single dot", ".", false}, {"ends with dot", "a.", false}, {"starts with dot", ".a", false}, @@ -115,7 +115,6 @@ func TestVCenter(t *testing.T) { {"contains non-ascii", "a日本語a", false}, {"URLs", "https://hello.openshift.org", false}, {"IP", "192.168.1.1", true}, - {"invalid IP", "192.168.1", false}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) {