mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #100879 from JaredTan95/remove_old_ip_checks
remove old ip checks.
This commit is contained in:
commit
b58a7e233e
@ -4085,12 +4085,8 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions
|
|||||||
allErrs = append(allErrs, ValidateContainerStateTransition(newPod.Status.InitContainerStatuses, oldPod.Status.InitContainerStatuses, fldPath.Child("initContainerStatuses"), oldPod.Spec.RestartPolicy)...)
|
allErrs = append(allErrs, ValidateContainerStateTransition(newPod.Status.InitContainerStatuses, oldPod.Status.InitContainerStatuses, fldPath.Child("initContainerStatuses"), oldPod.Spec.RestartPolicy)...)
|
||||||
|
|
||||||
if newIPErrs := validatePodIPs(newPod); len(newIPErrs) > 0 {
|
if newIPErrs := validatePodIPs(newPod); len(newIPErrs) > 0 {
|
||||||
// Tolerate IP errors if IP errors already existed in the old pod. See http://issue.k8s.io/90625
|
|
||||||
// TODO(liggitt): Drop the check of oldPod in 1.20
|
|
||||||
if oldIPErrs := validatePodIPs(oldPod); len(oldIPErrs) == 0 {
|
|
||||||
allErrs = append(allErrs, newIPErrs...)
|
allErrs = append(allErrs, newIPErrs...)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return allErrs
|
return allErrs
|
||||||
}
|
}
|
||||||
|
@ -16719,13 +16719,6 @@ func TestPodIPsValidation(t *testing.T) {
|
|||||||
oldPod.Name = newPod.Name
|
oldPod.Name = newPod.Name
|
||||||
|
|
||||||
errs := ValidatePodStatusUpdate(newPod, oldPod, PodValidationOptions{})
|
errs := ValidatePodStatusUpdate(newPod, oldPod, PodValidationOptions{})
|
||||||
if oldTestCase.expectError {
|
|
||||||
// The old pod was invalid, tolerate invalid IPs in the new pod as well
|
|
||||||
if len(errs) > 0 {
|
|
||||||
t.Fatalf("expected success for update to pod with already-invalid IPs, got errors: %v", errs)
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(errs) == 0 && testCase.expectError {
|
if len(errs) == 0 && testCase.expectError {
|
||||||
t.Fatalf("expected failure for %s, but there were none", testCase.pod.Name)
|
t.Fatalf("expected failure for %s, but there were none", testCase.pod.Name)
|
||||||
|
Loading…
Reference in New Issue
Block a user