Skip to content

Commit

Permalink
recover binder register and get
Browse files Browse the repository at this point in the history
Signed-off-by: lowang_bh <[email protected]>
  • Loading branch information
lowang-bh committed Jun 2, 2023
1 parent 655ca88 commit b4c0207
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ 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)
sc.Binder = NewBinder(sc.kubeClient, sc.Recorder)

var batchNum int
batchNum, err = strconv.Atoi(os.Getenv("BATCH_BIND_NUM"))
Expand All @@ -486,6 +485,11 @@ 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
13 changes: 13 additions & 0 deletions pkg/scheduler/cache/factory.go
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
package cache

// bindMethodMap Binder management
var bindMethodMap Binder

// RegisterBindMethod register Bind Method
func RegisterBindMethod(binder Binder) {
bindMethodMap = binder
}

// GetBindMethod get the registered Binder
func GetBindMethod() Binder {
return bindMethodMap
}

0 comments on commit b4c0207

Please sign in to comment.