@@ -285,7 +285,7 @@ func (sched *Scheduler) schedule(pod *v1.Pod) (core.ScheduleResult, error) {
285
285
}
286
286
287
287
// preempt tries to create room for a pod that has failed to schedule, by preempting lower priority pods if possible.
288
- // If it succeeds, it adds the name of the node where preemption has happened to the pod annotations .
288
+ // If it succeeds, it adds the name of the node where preemption has happened to the pod spec .
289
289
// It returns the node name and an error if any.
290
290
func (sched * Scheduler ) preempt (preemptor * v1.Pod , scheduleErr error ) (string , error ) {
291
291
preemptor , err := sched .config .PodPreemptor .GetUpdatedPod (preemptor )
@@ -310,7 +310,7 @@ func (sched *Scheduler) preempt(preemptor *v1.Pod, scheduleErr error) (string, e
310
310
// Make a call to update nominated node name of the pod on the API server.
311
311
err = sched .config .PodPreemptor .SetNominatedNodeName (preemptor , nodeName )
312
312
if err != nil {
313
- klog .Errorf ("Error in preemption process. Cannot update pod %v/%v annotations : %v" , preemptor .Namespace , preemptor .Name , err )
313
+ klog .Errorf ("Error in preemption process. Cannot set 'NominatedPod' on pod %v/%v: %v" , preemptor .Namespace , preemptor .Name , err )
314
314
sched .config .SchedulingQueue .DeleteNominatedPodIfExists (preemptor )
315
315
return "" , err
316
316
}
@@ -327,11 +327,12 @@ func (sched *Scheduler) preempt(preemptor *v1.Pod, scheduleErr error) (string, e
327
327
// Clearing nominated pods should happen outside of "if node != nil". Node could
328
328
// be nil when a pod with nominated node name is eligible to preempt again,
329
329
// but preemption logic does not find any node for it. In that case Preempt()
330
- // function of generic_scheduler.go returns the pod itself for removal of the annotation.
330
+ // function of generic_scheduler.go returns the pod itself for removal of
331
+ // the 'NominatedPod' field.
331
332
for _ , p := range nominatedPodsToClear {
332
333
rErr := sched .config .PodPreemptor .RemoveNominatedNodeName (p )
333
334
if rErr != nil {
334
- klog .Errorf ("Cannot remove nominated node annotation of pod: %v" , rErr )
335
+ klog .Errorf ("Cannot remove 'NominatedPod' field of pod: %v" , rErr )
335
336
// We do not return as this error is not critical.
336
337
}
337
338
}
0 commit comments