mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 12:46:06 +00:00
Extract logic related with scheduler nominatedPods to an interface
- rename `UpdateNominatedPodForNode` to `AddNominatedPod` - promote `update` to `UpdateNominatedPod` - anonymous lock in nominatedMap - pass PodNominator as an option to NewFramework
This commit is contained in:
@@ -402,7 +402,7 @@ func (sched *Scheduler) preempt(ctx context.Context, prof *profile.Profile, stat
|
||||
// Update the scheduling queue with the nominated pod information. Without
|
||||
// this, there would be a race condition between the next scheduling cycle
|
||||
// and the time the scheduler receives a Pod Update for the nominated pod.
|
||||
sched.SchedulingQueue.UpdateNominatedPodForNode(preemptor, nodeName)
|
||||
sched.SchedulingQueue.AddNominatedPod(preemptor, nodeName)
|
||||
|
||||
// Make a call to update nominated node name of the pod on the API server.
|
||||
err = sched.podPreemptor.setNominatedNodeName(preemptor, nodeName)
|
||||
|
Reference in New Issue
Block a user