Skip to content

Commit

Permalink
fix: be compatible: if there are no registered binder, then new binde…
Browse files Browse the repository at this point in the history
…r with default one

Signed-off-by: lowang-bh <[email protected]>
  • Loading branch information
lowang-bh committed Aug 14, 2023
1 parent 43dde53 commit ab25de0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ func newSchedulerCache(config *rest.Config, schedulerNames []string, defaultQueu
sc.Recorder = broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: commonutil.GenerateComponentName(sc.schedulerNames)})

sc.BindFlowChannel = make(chan *schedulingapi.TaskInfo, 5000)
if bindMethodMap == nil {
bindMethodMap = NewBinder(sc.kubeClient, sc.Recorder)
}
sc.Binder = GetBindMethod()

var batchNum int
batchNum, err = strconv.Atoi(os.Getenv("BATCH_BIND_NUM"))
Expand All @@ -485,11 +489,6 @@ func newSchedulerCache(config *rest.Config, schedulerNames []string, defaultQueu
sc.batchNum = 1
}

sc.Binder = &DefaultBinder{
kubeclient: sc.kubeClient,
recorder: sc.Recorder,
}

sc.Evictor = &defaultEvictor{
kubeclient: sc.kubeClient,
recorder: sc.Recorder,
Expand Down

0 comments on commit ab25de0

Please sign in to comment.