Skip to content

Commit

Permalink
Fix a bug in initializing scheduler
Browse files Browse the repository at this point in the history
By default scheduler now returns plugins instead of predicates.
However, plugins are not yet supported by CA, so we need to make
scheduler return predicates.
  • Loading branch information
MaciekPytel committed Nov 26, 2019
1 parent 51b8368 commit 2113e06
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cluster-autoscaler/simulator/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (

"k8s.io/kubernetes/pkg/scheduler"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
schedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
schedulerlisters "k8s.io/kubernetes/pkg/scheduler/listers"
schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo"
schedulersnapshot "k8s.io/kubernetes/pkg/scheduler/nodeinfo/snapshot"
Expand Down Expand Up @@ -113,18 +112,14 @@ func NewPredicateChecker(kubeClient kube_client.Interface, stop <-chan struct{})

informerFactory := informers.NewSharedInformerFactory(kubeClient, 0)
podInformer := informerFactory.Core().V1().Pods()
defaultProviderName := schedulerconfig.SchedulerDefaultProviderName
algorithmSource := schedulerconfig.SchedulerAlgorithmSource{
Provider: &defaultProviderName,
}

sched, err := scheduler.New(
kubeClient,
informerFactory,
podInformer,
NoOpEventRecorder{},
stop,
scheduler.WithAlgorithmSource(algorithmSource),
scheduler.WithFrameworkConfigProducerRegistry(nil),
)
if err != nil {
return nil, fmt.Errorf("couldn't create scheduler; %v", err)
Expand Down

0 comments on commit 2113e06

Please sign in to comment.