Merge pull request #100879 from JaredTan95/remove_old_ip_checks

remove old ip checks.
This commit is contained in:
Kubernetes Prow Robot 2021-05-04 15:39:14 -07:00 committed by GitHub
commit b58a7e233e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 12 deletions

View File

@ -4085,11 +4085,7 @@ func ValidatePodStatusUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions
allErrs = append(allErrs, ValidateContainerStateTransition(newPod.Status.InitContainerStatuses, oldPod.Status.InitContainerStatuses, fldPath.Child("initContainerStatuses"), oldPod.Spec.RestartPolicy)...)
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

View File

@ -16719,13 +16719,6 @@ func TestPodIPsValidation(t *testing.T) {
oldPod.Name = newPod.Name
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 {
t.Fatalf("expected failure for %s, but there were none", testCase.pod.Name)