fix deschedulerestimator connection error
Signed-off-by: carlory <baofa.fan@daocloud.io>
This commit is contained in:
parent
4870c30f9d
commit
a98a551c5d
|
@ -61,17 +61,18 @@ type Descheduler struct {
|
||||||
func NewDescheduler(karmadaClient karmadaclientset.Interface, kubeClient kubernetes.Interface, opts *options.Options) *Descheduler {
|
func NewDescheduler(karmadaClient karmadaclientset.Interface, kubeClient kubernetes.Interface, opts *options.Options) *Descheduler {
|
||||||
factory := informerfactory.NewSharedInformerFactory(karmadaClient, 0)
|
factory := informerfactory.NewSharedInformerFactory(karmadaClient, 0)
|
||||||
desched := &Descheduler{
|
desched := &Descheduler{
|
||||||
KarmadaClient: karmadaClient,
|
KarmadaClient: karmadaClient,
|
||||||
KubeClient: kubeClient,
|
KubeClient: kubeClient,
|
||||||
informerFactory: factory,
|
informerFactory: factory,
|
||||||
bindingInformer: factory.Work().V1alpha2().ResourceBindings().Informer(),
|
bindingInformer: factory.Work().V1alpha2().ResourceBindings().Informer(),
|
||||||
bindingLister: factory.Work().V1alpha2().ResourceBindings().Lister(),
|
bindingLister: factory.Work().V1alpha2().ResourceBindings().Lister(),
|
||||||
clusterInformer: factory.Cluster().V1alpha1().Clusters().Informer(),
|
clusterInformer: factory.Cluster().V1alpha1().Clusters().Informer(),
|
||||||
clusterLister: factory.Cluster().V1alpha1().Clusters().Lister(),
|
clusterLister: factory.Cluster().V1alpha1().Clusters().Lister(),
|
||||||
schedulerEstimatorCache: estimatorclient.NewSchedulerEstimatorCache(),
|
schedulerEstimatorCache: estimatorclient.NewSchedulerEstimatorCache(),
|
||||||
schedulerEstimatorPort: opts.SchedulerEstimatorPort,
|
schedulerEstimatorPort: opts.SchedulerEstimatorPort,
|
||||||
unschedulableThreshold: opts.UnschedulableThreshold.Duration,
|
schedulerEstimatorServicePrefix: opts.SchedulerEstimatorServicePrefix,
|
||||||
deschedulingInterval: opts.DeschedulingInterval.Duration,
|
unschedulableThreshold: opts.UnschedulableThreshold.Duration,
|
||||||
|
deschedulingInterval: opts.DeschedulingInterval.Duration,
|
||||||
}
|
}
|
||||||
// ignore the error here because the informers haven't been started
|
// ignore the error here because the informers haven't been started
|
||||||
_ = desched.bindingInformer.SetTransform(fedinformer.StripUnusedFields)
|
_ = desched.bindingInformer.SetTransform(fedinformer.StripUnusedFields)
|
||||||
|
|
Loading…
Reference in New Issue