Move informer event handlers to Scheduler

This commit is contained in:
Mayank Kumar
2018-10-01 14:57:17 -07:00
parent d57d606275
commit e0a7d96632
13 changed files with 856 additions and 690 deletions

View File

@@ -138,7 +138,6 @@ func New(client clientset.Interface,
for _, opt := range opts {
opt(&options)
}
// Set up the configurator which can create schedulers from configs.
configurator := factory.NewConfigFactory(&factory.ConfigFactoryArgs{
SchedulerName: options.schedulerName,
@@ -193,8 +192,11 @@ func New(client clientset.Interface,
config.Recorder = recorder
config.DisablePreemption = options.disablePreemption
config.StopEverything = stopCh
// Create the scheduler.
sched := NewFromConfig(config)
AddAllEventHandlers(sched, options.schedulerName, nodeInformer, podInformer, pvInformer, pvcInformer, replicationControllerInformer, replicaSetInformer, statefulSetInformer, serviceInformer, pdbInformer, storageClassInformer)
return sched, nil
}