mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #106397 from shawnhanx/core_validation
fix S1017 and S1002 in pkg/apis/core/validation/validation.go
This commit is contained in:
commit
a7905d76c7
@ -3236,9 +3236,7 @@ func validatePodDNSConfig(dnsConfig *core.PodDNSConfig, dnsPolicy *core.DNSPolic
|
|||||||
}
|
}
|
||||||
for i, search := range dnsConfig.Searches {
|
for i, search := range dnsConfig.Searches {
|
||||||
// it is fine to have a trailing dot
|
// it is fine to have a trailing dot
|
||||||
if strings.HasSuffix(search, ".") {
|
search = strings.TrimSuffix(search, ".")
|
||||||
search = search[0 : len(search)-1]
|
|
||||||
}
|
|
||||||
allErrs = append(allErrs, ValidateDNS1123Subdomain(search, fldPath.Child("searches").Index(i))...)
|
allErrs = append(allErrs, ValidateDNS1123Subdomain(search, fldPath.Child("searches").Index(i))...)
|
||||||
}
|
}
|
||||||
// Validate options.
|
// Validate options.
|
||||||
@ -6380,7 +6378,7 @@ func validateWindowsHostProcessPod(podSpec *core.PodSpec, fieldPath *field.Path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// At present Windows Pods which contain HostProcess containers must also set HostNetwork.
|
// At present Windows Pods which contain HostProcess containers must also set HostNetwork.
|
||||||
if hostNetwork != true {
|
if !hostNetwork {
|
||||||
errMsg := "hostNetwork must be true if pod contains any hostProcess containers"
|
errMsg := "hostNetwork must be true if pod contains any hostProcess containers"
|
||||||
allErrs = append(allErrs, field.Invalid(fieldPath.Child("hostNetwork"), hostNetwork, errMsg))
|
allErrs = append(allErrs, field.Invalid(fieldPath.Child("hostNetwork"), hostNetwork, errMsg))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user