mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Never attempt a resize of windows pods
This commit is contained in:
parent
a5dda5d879
commit
6df3ea46d9
@ -22,6 +22,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
@ -551,19 +552,19 @@ func containerSucceeded(c *v1.Container, podStatus *kubecontainer.PodStatus) boo
|
||||
}
|
||||
|
||||
func IsInPlacePodVerticalScalingAllowed(pod *v1.Pod) bool {
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) {
|
||||
return false
|
||||
}
|
||||
if types.IsStaticPod(pod) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) &&
|
||||
!types.IsStaticPod(pod) &&
|
||||
runtime.GOOS != "windows"
|
||||
}
|
||||
|
||||
// computePodResizeAction determines the actions required (if any) to resize the given container.
|
||||
// Returns whether to keep (true) or restart (false) the container.
|
||||
// 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`).
|
||||
func (m *kubeGenericRuntimeManager) computePodResizeAction(pod *v1.Pod, containerIdx int, isRestartableInitContainer bool, kubeContainerStatus *kubecontainer.Status, changes *podActions) (keepContainer bool) {
|
||||
if !IsInPlacePodVerticalScalingAllowed(pod) {
|
||||
return true
|
||||
}
|
||||
|
||||
var container v1.Container
|
||||
if isRestartableInitContainer {
|
||||
container = pod.Spec.InitContainers[containerIdx]
|
||||
@ -1092,7 +1093,7 @@ func (m *kubeGenericRuntimeManager) computePodActions(ctx context.Context, pod *
|
||||
// If the container failed the startup probe, we should kill it.
|
||||
message = fmt.Sprintf("Container %s failed startup probe", container.Name)
|
||||
reason = reasonStartupProbe
|
||||
} else if IsInPlacePodVerticalScalingAllowed(pod) && !m.computePodResizeAction(pod, idx, false, containerStatus, &changes) {
|
||||
} else if !m.computePodResizeAction(pod, idx, false, containerStatus, &changes) {
|
||||
// computePodResizeAction updates 'changes' if resize policy requires restarting this container
|
||||
continue
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user