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

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-15 01:01:18 -07:00 committed by GitHub
commit cd0ea55142
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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