mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Trival fix: update the description on the pod preemption
`pod` has the field of `NominatedNodeName` which is different with `NominatedPod`.
This commit is contained in:
parent
5383e01d2a
commit
a9d82e7c2a
@ -412,7 +412,7 @@ func (sched *Scheduler) preempt(ctx context.Context, prof *profile.Profile, stat
|
|||||||
// Make a call to update nominated node name of the pod on the API server.
|
// Make a call to update nominated node name of the pod on the API server.
|
||||||
err = sched.podPreemptor.setNominatedNodeName(preemptor, nodeName)
|
err = sched.podPreemptor.setNominatedNodeName(preemptor, nodeName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("Error in preemption process. Cannot set 'NominatedPod' on pod %v/%v: %v", preemptor.Namespace, preemptor.Name, err)
|
klog.Errorf("Error in preemption process. Cannot set 'NominatedNodeName' on pod %v/%v: %v", preemptor.Namespace, preemptor.Name, err)
|
||||||
sched.SchedulingQueue.DeleteNominatedPodIfExists(preemptor)
|
sched.SchedulingQueue.DeleteNominatedPodIfExists(preemptor)
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -435,11 +435,11 @@ func (sched *Scheduler) preempt(ctx context.Context, prof *profile.Profile, stat
|
|||||||
// be nil when a pod with nominated node name is eligible to preempt again,
|
// be nil when a pod with nominated node name is eligible to preempt again,
|
||||||
// but preemption logic does not find any node for it. In that case Preempt()
|
// but preemption logic does not find any node for it. In that case Preempt()
|
||||||
// function of generic_scheduler.go returns the pod itself for removal of
|
// function of generic_scheduler.go returns the pod itself for removal of
|
||||||
// the 'NominatedPod' field.
|
// the 'NominatedNodeName' field.
|
||||||
for _, p := range nominatedPodsToClear {
|
for _, p := range nominatedPodsToClear {
|
||||||
rErr := sched.podPreemptor.removeNominatedNodeName(p)
|
rErr := sched.podPreemptor.removeNominatedNodeName(p)
|
||||||
if rErr != nil {
|
if rErr != nil {
|
||||||
klog.Errorf("Cannot remove 'NominatedPod' field of pod: %v", rErr)
|
klog.Errorf("Cannot remove 'NominatedNodeName' field of pod: %v", rErr)
|
||||||
// We do not return as this error is not critical.
|
// We do not return as this error is not critical.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user