Only set pod allocation if admission succeeds

This commit is contained in:
Tim Allclair
2025-06-04 11:45:12 -07:00
parent 45d267ca16
commit 705e89b046

View File

@@ -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