mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Don't automatically clear in-progress status when resize is not allowed
This commit is contained in:
parent
523a19aa44
commit
cb5c8d159c
@ -2873,15 +2873,6 @@ func (kl *Kubelet) canResizePod(pod *v1.Pod) (bool, v1.PodResizeStatus, string)
|
|||||||
// the allocation decision and pod status.
|
// the allocation decision and pod status.
|
||||||
func (kl *Kubelet) handlePodResourcesResize(pod *v1.Pod, podStatus *kubecontainer.PodStatus) (*v1.Pod, error) {
|
func (kl *Kubelet) handlePodResourcesResize(pod *v1.Pod, podStatus *kubecontainer.PodStatus) (*v1.Pod, error) {
|
||||||
allocatedPod, updated := kl.allocationManager.UpdatePodFromAllocation(pod)
|
allocatedPod, updated := kl.allocationManager.UpdatePodFromAllocation(pod)
|
||||||
if resizable, msg := kuberuntime.IsInPlacePodVerticalScalingAllowed(pod); !resizable {
|
|
||||||
if updated {
|
|
||||||
kl.recorder.Eventf(pod, v1.EventTypeWarning, events.ResizeInfeasible, msg)
|
|
||||||
kl.statusManager.SetPodResizeStatus(pod.UID, v1.PodResizeStatusInfeasible)
|
|
||||||
} else {
|
|
||||||
kl.statusManager.SetPodResizeStatus(pod.UID, "")
|
|
||||||
}
|
|
||||||
return allocatedPod, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if !updated {
|
if !updated {
|
||||||
// Desired resources == allocated resources. Check whether a resize is in progress.
|
// Desired resources == allocated resources. Check whether a resize is in progress.
|
||||||
@ -2895,6 +2886,11 @@ func (kl *Kubelet) handlePodResourcesResize(pod *v1.Pod, podStatus *kubecontaine
|
|||||||
}
|
}
|
||||||
// Pod allocation does not need to be updated.
|
// Pod allocation does not need to be updated.
|
||||||
return allocatedPod, nil
|
return allocatedPod, nil
|
||||||
|
} else if resizable, msg := kuberuntime.IsInPlacePodVerticalScalingAllowed(pod); !resizable {
|
||||||
|
// If there is a pending resize but the resize is not allowed, always use the allocated resources.
|
||||||
|
kl.recorder.Eventf(pod, v1.EventTypeWarning, events.ResizeInfeasible, msg)
|
||||||
|
kl.statusManager.SetPodResizeStatus(pod.UID, v1.PodResizeStatusInfeasible)
|
||||||
|
return allocatedPod, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
kl.podResizeMutex.Lock()
|
kl.podResizeMutex.Lock()
|
||||||
|
Loading…
Reference in New Issue
Block a user