fix a scheduler preemption issue that victim is not patched properly

This commit is contained in:
Wei Huang 2024-08-12 15:25:10 -07:00
parent 8991b8ea60
commit 9eec84c67f
No known key found for this signature in database
GPG Key ID: 17AFE05D01EA77B2

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 {