mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-06 00:05:52 +00:00
Remove wrappers around storage-related listers in the predicate
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
This commit is contained in:
@@ -52,20 +52,12 @@ func (pl *CSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v
|
||||
// NewCSI initializes a new plugin and returns it.
|
||||
func NewCSI(_ *runtime.Unknown, handle framework.FrameworkHandle) (framework.Plugin, error) {
|
||||
informerFactory := handle.SharedInformerFactory()
|
||||
csiNodeInfo := &predicates.CachedCSINodeInfo{
|
||||
CSINodeLister: informerFactory.Storage().V1beta1().CSINodes().Lister(),
|
||||
}
|
||||
pvInfo := &predicates.CachedPersistentVolumeInfo{
|
||||
PersistentVolumeLister: informerFactory.Core().V1().PersistentVolumes().Lister(),
|
||||
}
|
||||
pvcInfo := &predicates.CachedPersistentVolumeClaimInfo{
|
||||
PersistentVolumeClaimLister: informerFactory.Core().V1().PersistentVolumeClaims().Lister(),
|
||||
}
|
||||
classInfo := &predicates.CachedStorageClassInfo{
|
||||
StorageClassLister: informerFactory.Storage().V1().StorageClasses().Lister(),
|
||||
}
|
||||
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 &CSILimits{
|
||||
predicate: predicates.NewCSIMaxVolumeLimitPredicate(csiNodeInfo, pvInfo, pvcInfo, classInfo),
|
||||
predicate: predicates.NewCSIMaxVolumeLimitPredicate(csiNodeLister, pvLister, pvcLister, scLister),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user