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

@@ -52,12 +52,11 @@ func (pl *AzureDiskLimits) Filter(ctx context.Context, _ *framework.CycleState,
// NewAzureDisk returns function that initializes a new plugin and returns it.
func NewAzureDisk(_ *runtime.Unknown, handle framework.FrameworkHandle) (framework.Plugin, error) {
informerFactory := handle.SharedInformerFactory()
csiNodeLister := informerFactory.Storage().V1beta1().CSINodes().Lister()
pvLister := informerFactory.Core().V1().PersistentVolumes().Lister()
pvcLister := informerFactory.Core().V1().PersistentVolumeClaims().Lister()
scLister := informerFactory.Storage().V1().StorageClasses().Lister()
return &AzureDiskLimits{
predicate: predicates.NewMaxPDVolumeCountPredicate(predicates.AzureDiskVolumeFilterType, csiNodeLister, scLister, pvLister, pvcLister),
predicate: predicates.NewMaxPDVolumeCountPredicate(predicates.AzureDiskVolumeFilterType, getCSINodeListerIfEnabled(informerFactory), scLister, pvLister, pvcLister),
}, nil
}