Skip to content

Commit 03e8154

Browse files
authored
Merge pull request kubernetes#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
2 parents 8917950 + f6a11da commit 03e8154

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/scheduler/framework/preemption/preemption.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func (ev *Evaluator) prepareCandidate(ctx context.Context, c Candidate, pod *v1.
368368
Reason: v1.PodReasonPreemptionByScheduler,
369369
Message: fmt.Sprintf("%s: preempting to accommodate a higher priority pod", pod.Spec.SchedulerName),
370370
}
371-
newStatus := pod.Status.DeepCopy()
371+
newStatus := victim.Status.DeepCopy()
372372
updated := apipod.UpdatePodCondition(newStatus, condition)
373373
if updated {
374374
if err := util.PatchPodStatus(ctx, cs, victim, newStatus); err != nil {

0 commit comments

Comments
 (0)