From 705e89b046f60dbbc874d959b1a89ddaf04458f5 Mon Sep 17 00:00:00 2001 From: Tim Allclair Date: Wed, 4 Jun 2025 11:45:12 -0700 Subject: [PATCH] Only set pod allocation if admission succeeds --- pkg/kubelet/allocation/allocation_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/allocation/allocation_manager.go b/pkg/kubelet/allocation/allocation_manager.go index 7a977b7d4d9..c56816ca7b5 100644 --- a/pkg/kubelet/allocation/allocation_manager.go +++ b/pkg/kubelet/allocation/allocation_manager.go @@ -243,7 +243,7 @@ func (m *manager) AddPod(activePods []*v1.Pod, pod *v1.Pod) (bool, string, strin allocatedPods := m.getAllocatedPods(activePods) ok, reason, message := m.canAdmitPod(allocatedPods, pod) - if utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { + if ok && utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScaling) { // Checkpoint the resource values at which the Pod has been admitted or resized. if err := m.SetAllocatedResources(pod); err != nil { // TODO(vinaykul,InPlacePodVerticalScaling): Can we recover from this in some way? Investigate