scheduler: make Profile an interface.

This commit is contained in:
tangwz
2020-10-19 10:43:50 +08:00
parent 5935fcd704
commit 5f3efa671d
14 changed files with 129 additions and 228 deletions

View File

@@ -205,14 +205,14 @@ func (sched *Scheduler) deletePodFromSchedulingQueue(obj interface{}) {
if err := sched.SchedulingQueue.Delete(pod); err != nil {
utilruntime.HandleError(fmt.Errorf("unable to dequeue %T: %v", obj, err))
}
prof, err := sched.profileForPod(pod)
fwk, err := sched.frameworkForPod(pod)
if err != nil {
// This shouldn't happen, because we only accept for scheduling the pods
// which specify a scheduler name that matches one of the profiles.
klog.Error(err)
return
}
prof.Framework.RejectWaitingPod(pod.UID)
fwk.RejectWaitingPod(pod.UID)
}
func (sched *Scheduler) addPodToCache(obj interface{}) {