Merge pull request #91037 from Huang-Wei/prefactor-PreemptExtender

Refactor preemption extender logic and move SchedulerExtender interface to framework pkg
This commit is contained in:
Kubernetes Prow Robot
2020-05-15 02:48:30 -07:00
committed by GitHub
10 changed files with 182 additions and 171 deletions

View File

@@ -393,14 +393,12 @@ func (sched *Scheduler) preempt(ctx context.Context, prof *profile.Profile, stat
return "", err
}
node, victims, nominatedPodsToClear, err := sched.Algorithm.Preempt(ctx, prof, state, preemptor, scheduleErr)
nodeName, victims, nominatedPodsToClear, err := sched.Algorithm.Preempt(ctx, prof, state, preemptor, scheduleErr)
if err != nil {
klog.Errorf("Error preempting victims to make room for %v/%v: %v", preemptor.Namespace, preemptor.Name, err)
return "", err
}
var nodeName = ""
if node != nil {
nodeName = node.Name
if len(nodeName) != 0 {
// 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.