Merge pull request #126691 from Huang-Wei/automated-cherry-pick-of-#126644-upstream-release-1.31

Automated cherry pick of #126644: fix a scheduler preemption issue that victim is not patched
This commit is contained in:
Kubernetes Prow Robot 2024-08-14 23:57:18 -07:00 committed by GitHub
commit 60a402c924
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -366,7 +366,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 {