Feature-gate CSINode and CSIDriver informer starts

This commit is contained in:
Jordan Liggitt
2019-10-24 00:33:43 -04:00
parent 3f402534f3
commit 0e2f2dde4d
11 changed files with 75 additions and 18 deletions

View File

@@ -33,6 +33,7 @@ import (
"k8s.io/client-go/informers"
coreinformers "k8s.io/client-go/informers/core/v1"
policyv1beta1informers "k8s.io/client-go/informers/policy/v1beta1"
storagev1beta1informers "k8s.io/client-go/informers/storage/v1beta1"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/events"
@@ -287,6 +288,11 @@ func New(client clientset.Interface,
pdbInformer = informerFactory.Policy().V1beta1().PodDisruptionBudgets()
}
var csiNodeInformer storagev1beta1informers.CSINodeInformer
if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.CSINodeInfo) {
csiNodeInformer = informerFactory.Storage().V1beta1().CSINodes()
}
// Set up the configurator which can create schedulers from configs.
configurator := NewConfigFactory(&ConfigFactoryArgs{
Client: client,
@@ -301,7 +307,7 @@ func New(client clientset.Interface,
ServiceInformer: informerFactory.Core().V1().Services(),
PdbInformer: pdbInformer,
StorageClassInformer: informerFactory.Storage().V1().StorageClasses(),
CSINodeInformer: informerFactory.Storage().V1beta1().CSINodes(),
CSINodeInformer: csiNodeInformer,
VolumeBinder: volumeBinder,
SchedulerCache: schedulerCache,
HardPodAffinitySymmetricWeight: options.hardPodAffinitySymmetricWeight,