@@ -5644,6 +5644,11 @@ func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel
5644
5644
var newContainers []core.Container
5645
5645
for ix , container := range originalCPUMemPodSpec .Containers {
5646
5646
dropCPUMemoryResourcesFromContainer (& container , & oldPod .Spec .Containers [ix ])
5647
+ if ! apiequality .Semantic .DeepEqual (container , oldPod .Spec .Containers [ix ]) {
5648
+ // This likely means that the user has made changes to resources other than CPU and memory for regular container.
5649
+ errs := field .Forbidden (specPath , "only cpu and memory resources are mutable" )
5650
+ allErrs = append (allErrs , errs )
5651
+ }
5647
5652
newContainers = append (newContainers , container )
5648
5653
}
5649
5654
originalCPUMemPodSpec .Containers = newContainers
@@ -5676,8 +5681,7 @@ func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel
5676
5681
5677
5682
if ! apiequality .Semantic .DeepEqual (originalCPUMemPodSpec , oldPod .Spec ) {
5678
5683
// This likely means that the user has made changes to resources other than CPU and Memory.
5679
- specDiff := cmp .Diff (oldPod .Spec , originalCPUMemPodSpec )
5680
- errs := field .Forbidden (specPath , fmt .Sprintf ("only cpu and memory resources are mutable\n %v" , specDiff ))
5684
+ errs := field .Forbidden (specPath , "only cpu and memory resources are mutable" )
5681
5685
allErrs = append (allErrs , errs )
5682
5686
}
5683
5687
return allErrs
0 commit comments