@@ -26073,6 +26073,16 @@ func TestValidatePodResize(t *testing.T) {
26073
26073
old: mkPodWithInitContainers(getResources("100m", "0", "1Gi", ""), core.ResourceList{}, core.ContainerRestartPolicyAlways),
26074
26074
new: mkPodWithInitContainers(getResources("100m", "0", "2Gi", ""), core.ResourceList{}, core.ContainerRestartPolicyAlways),
26075
26075
err: "spec: Forbidden: only cpu and memory resources for sidecar containers are mutable",
26076
+ }, {
26077
+ test: "change resize restart policy",
26078
+ old: mkPod(getResources("100m", "0", "1Gi", ""), core.ResourceList{}, resizePolicy(core.ResourceCPU, core.NotRequired)),
26079
+ new: mkPod(getResources("100m", "0", "2Gi", ""), core.ResourceList{}, resizePolicy(core.ResourceCPU, core.RestartContainer)),
26080
+ err: "spec: Forbidden: only cpu and memory resources are mutable",
26081
+ }, {
26082
+ test: "change sidecar container resize restart policy",
26083
+ old: mkPodWithInitContainers(getResources("100m", "0", "1Gi", ""), core.ResourceList{}, core.ContainerRestartPolicyAlways, resizePolicy(core.ResourceMemory, core.RestartContainer)),
26084
+ new: mkPodWithInitContainers(getResources("100m", "0", "2Gi", ""), core.ResourceList{}, core.ContainerRestartPolicyAlways, resizePolicy(core.ResourceMemory, core.NotRequired)),
26085
+ err: "spec: Forbidden: only cpu and memory resources are mutable",
26076
26086
},
26077
26087
}
26078
26088
0 commit comments