Skip to content

Commit 6df3ea4

Browse files
committed
Never attempt a resize of windows pods
1 parent a5dda5d commit 6df3ea4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pkg/kubelet/kuberuntime/kuberuntime_manager.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323
"os"
2424
"path/filepath"
25+
"runtime"
2526
"sort"
2627
"time"
2728

@@ -551,19 +552,19 @@ func containerSucceeded(c *v1.Container, podStatus *kubecontainer.PodStatus) boo
551552
}
552553

553554
func IsInPlacePodVerticalScalingAllowed(pod *v1.Pod) bool {
554-
if !utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) {
555-
return false
556-
}
557-
if types.IsStaticPod(pod) {
558-
return false
559-
}
560-
return true
555+
return utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) &&
556+
!types.IsStaticPod(pod) &&
557+
runtime.GOOS != "windows"
561558
}
562559

563560
// computePodResizeAction determines the actions required (if any) to resize the given container.
564561
// Returns whether to keep (true) or restart (false) the container.
565562
// TODO(vibansal): Make this function to be agnostic to whether it is dealing with a restartable init container or not (i.e. remove the argument `isRestartableInitContainer`).
566563
func (m *kubeGenericRuntimeManager) computePodResizeAction(pod *v1.Pod, containerIdx int, isRestartableInitContainer bool, kubeContainerStatus *kubecontainer.Status, changes *podActions) (keepContainer bool) {
564+
if !IsInPlacePodVerticalScalingAllowed(pod) {
565+
return true
566+
}
567+
567568
var container v1.Container
568569
if isRestartableInitContainer {
569570
container = pod.Spec.InitContainers[containerIdx]
@@ -1092,7 +1093,7 @@ func (m *kubeGenericRuntimeManager) computePodActions(ctx context.Context, pod *
10921093
// If the container failed the startup probe, we should kill it.
10931094
message = fmt.Sprintf("Container %s failed startup probe", container.Name)
10941095
reason = reasonStartupProbe
1095-
} else if IsInPlacePodVerticalScalingAllowed(pod) && !m.computePodResizeAction(pod, idx, false, containerStatus, &changes) {
1096+
} else if !m.computePodResizeAction(pod, idx, false, containerStatus, &changes) {
10961097
// computePodResizeAction updates 'changes' if resize policy requires restarting this container
10971098
continue
10981099
} else {

0 commit comments

Comments
 (0)