mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +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"))
|
allErrs = append(allErrs, field.Invalid(fldPath.Child("ip"), hostAlias.IP, "must be valid IP address"))
|
||||||
}
|
}
|
||||||
for _, hostname := range hostAlias.Hostnames {
|
for _, hostname := range hostAlias.Hostnames {
|
||||||
allErrs = append(allErrs, ValidateDNS1123Label(hostname, fldPath.Child("hostnames"))...)
|
allErrs = append(allErrs, ValidateDNS1123Subdomain(hostname, fldPath.Child("hostnames"))...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return allErrs
|
return allErrs
|
||||||
|
Loading…
Reference in New Issue
Block a user