mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
drop InPlacePodVerticalScaling support in windows
This commit is contained in:
@@ -5503,6 +5503,11 @@ func ValidatePodResize(newPod, oldPod *core.Pod, opts PodValidationOptions) fiel
|
||||
return field.ErrorList{field.Forbidden(field.NewPath(""), "static pods cannot be resized")}
|
||||
}
|
||||
|
||||
// windows pods are not supported.
|
||||
if oldPod.Spec.OS != nil && oldPod.Spec.OS.Name == core.Windows {
|
||||
return field.ErrorList{field.Forbidden(field.NewPath(""), "windows pods cannot be resized")}
|
||||
}
|
||||
|
||||
// Part 2: Validate that the changes between oldPod.Spec.Containers[].Resources and
|
||||
// newPod.Spec.Containers[].Resources are allowed.
|
||||
specPath := field.NewPath("spec")
|
||||
|
||||
@@ -25075,22 +25075,20 @@ func TestValidateSELinuxChangePolicy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestValidatePodResize(t *testing.T) {
|
||||
mkPod := func(req, lim core.ResourceList, tweaks ...podtest.TweakContainer) *core.Pod {
|
||||
return podtest.MakePod("pod",
|
||||
mkPod := func(req, lim core.ResourceList, tweaks ...podtest.Tweak) *core.Pod {
|
||||
return podtest.MakePod("pod", append(tweaks,
|
||||
podtest.SetContainers(
|
||||
podtest.MakeContainer(
|
||||
"container",
|
||||
append(tweaks,
|
||||
podtest.SetContainerResources(
|
||||
core.ResourceRequirements{
|
||||
Requests: req,
|
||||
Limits: lim,
|
||||
},
|
||||
),
|
||||
)...,
|
||||
podtest.SetContainerResources(
|
||||
core.ResourceRequirements{
|
||||
Requests: req,
|
||||
Limits: lim,
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
)...)
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
@@ -25179,6 +25177,16 @@ func TestValidatePodResize(t *testing.T) {
|
||||
old: mkPod(getResources("100m", "100Mi", "", ""), getResources("200m", "200Mi", "", "")),
|
||||
new: mkPod(core.ResourceList{}, core.ResourceList{}),
|
||||
err: "Pod QOS Class may not change as a result of resizing",
|
||||
}, {
|
||||
test: "windows pod, no resource change",
|
||||
old: mkPod(core.ResourceList{}, getResources("100m", "0", "1Gi", ""), podtest.SetOS(core.Windows)),
|
||||
new: mkPod(core.ResourceList{}, getResources("100m", "0", "1Gi", ""), podtest.SetOS(core.Windows)),
|
||||
err: "Forbidden: windows pods cannot be resized",
|
||||
}, {
|
||||
test: "windows pod, resource change",
|
||||
old: mkPod(core.ResourceList{}, getResources("100m", "0", "1Gi", ""), podtest.SetOS(core.Windows)),
|
||||
new: mkPod(core.ResourceList{}, getResources("200m", "0", "1Gi", ""), podtest.SetOS(core.Windows)),
|
||||
err: "Forbidden: windows pods cannot be resized",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user