Make IsDNS1123Subdomain return error strings

This commit is contained in:
Tim Hockin
2015-12-16 21:58:09 -08:00
parent 77eff06a53
commit 5862a60ae7
6 changed files with 29 additions and 19 deletions

View File

@@ -353,7 +353,7 @@ func validateIngressRules(IngressRules []extensions.IngressRule, fldPath *field.
if len(ih.Host) > 0 {
// TODO: Ports and ips are allowed in the host part of a url
// according to RFC 3986, consider allowing them.
for _, msg := range apivalidation.NameIsDNSSubdomain(ih.Host, false) {
for _, msg := range validation.IsDNS1123Subdomain(ih.Host) {
allErrs = append(allErrs, field.Invalid(fldPath.Index(i).Child("host"), ih.Host, msg))
}
if isIP := (net.ParseIP(ih.Host) != nil); isIP {