Merge pull request #126644 from Huang-Wei/fix-preemption

Fix a scheduler preemption issue where the victim isn't properly patched, leading to preemption not functioning as expected
This commit is contained in:
Kubernetes Prow Robot
2024-08-13 22:12:09 -07:00
committed by GitHub

View File

@@ -368,7 +368,7 @@ func (ev *Evaluator) prepareCandidate(ctx context.Context, c Candidate, pod *v1.
Reason: v1.PodReasonPreemptionByScheduler,
Message: fmt.Sprintf("%s: preempting to accommodate a higher priority pod", pod.Spec.SchedulerName),
}
newStatus := pod.Status.DeepCopy()
newStatus := victim.Status.DeepCopy()
updated := apipod.UpdatePodCondition(newStatus, condition)
if updated {
if err := util.PatchPodStatus(ctx, cs, victim, newStatus); err != nil {