validation: allow trailing period in dns search
The trailing period tells the resolver to stop immediately instead of trying recursively. With that said, trailing period should be acceptable in searches.
This commit is contained in:
@@ -2695,6 +2695,10 @@ func validatePodDNSConfig(dnsConfig *core.PodDNSConfig, dnsPolicy *core.DNSPolic
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("searches"), dnsConfig.Searches, "must not have more than 256 characters (including spaces) in the search list"))
|
||||
}
|
||||
for i, search := range dnsConfig.Searches {
|
||||
// it is fine to have a trailing dot
|
||||
if strings.HasSuffix(search, ".") {
|
||||
search = search[0 : len(search)-1]
|
||||
}
|
||||
allErrs = append(allErrs, ValidateDNS1123Subdomain(search, fldPath.Child("searches").Index(i))...)
|
||||
}
|
||||
// Validate options.
|
||||
|
Reference in New Issue
Block a user