mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
validate DNS1123 domains instead of just labels
This commit is contained in:
parent
b3b6423016
commit
0e5c84e554
@ -2105,7 +2105,7 @@ func ValidateHostAliases(hostAliases []api.HostAlias, fldPath *field.Path) field
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("ip"), hostAlias.IP, "must be valid IP address"))
|
||||
}
|
||||
for _, hostname := range hostAlias.Hostnames {
|
||||
allErrs = append(allErrs, ValidateDNS1123Label(hostname, fldPath.Child("hostnames"))...)
|
||||
allErrs = append(allErrs, ValidateDNS1123Subdomain(hostname, fldPath.Child("hostnames"))...)
|
||||
}
|
||||
}
|
||||
return allErrs
|
||||
|
Loading…
Reference in New Issue
Block a user