Skip to content

Commit 7ac302b

Browse files
committed
test: cleanup validation tests
1 parent dc3c4ed commit 7ac302b

File tree

2 files changed

+199
-375
lines changed

2 files changed

+199
-375
lines changed

pkg/apis/core/validation/validation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5504,7 +5504,7 @@ func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel
55045504
// newPod.Spec.Containers[].Resources are allowed.
55055505
specPath := field.NewPath("spec")
55065506
if qos.GetPodQOS(oldPod) != qos.ComputePodQOS(newPod) {
5507-
allErrs = append(allErrs, field.Invalid(specPath, newPod.Status.QOSClass, "Pod QOS Class must not change"))
5507+
allErrs = append(allErrs, field.Invalid(specPath, newPod.Status.QOSClass, "Pod QOS Class may not change as a result of resizing"))
55085508
}
55095509

55105510
// Ensure that only CPU and memory resources are mutable.
@@ -5539,7 +5539,7 @@ func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel
55395539
}
55405540
mungedPodSpec.Containers = newContainers
55415541
if !apiequality.Semantic.DeepEqual(mungedPodSpec, oldPod.Spec) {
5542-
// This likely means that the user has made changes to CPU and Memory resources.
5542+
// This likely means that the user has made changes to resources other than CPU and Memory.
55435543
specDiff := cmp.Diff(oldPod.Spec, mungedPodSpec)
55445544
errs := field.Forbidden(specPath, fmt.Sprintf("pod resize may not change fields other than cpu and memory\n%v", specDiff))
55455545
allErrs = append(allErrs, errs)

0 commit comments

Comments
 (0)