Merge pull request #108445 from pohly/storage-capacity-ga

storage capacity GA
This commit is contained in:
Kubernetes Prow Robot
2022-03-23 08:06:21 -07:00
committed by GitHub
66 changed files with 5284 additions and 440 deletions

View File

@@ -107,14 +107,10 @@ func (pl *VolumeBinding) EventsToRegister() []framework.ClusterEvent {
{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeLabel},
// We rely on CSI node to translate in-tree PV to CSI.
{Resource: framework.CSINode, ActionType: framework.Add | framework.Update},
}
if pl.fts.EnableCSIStorageCapacity {
// When CSIStorageCapacity is enabled, pods may become schedulable
// on CSI driver & storage capacity changes.
events = append(events, []framework.ClusterEvent{
{Resource: framework.CSIDriver, ActionType: framework.Add | framework.Update},
{Resource: framework.CSIStorageCapacity, ActionType: framework.Add | framework.Update},
}...)
{Resource: framework.CSIDriver, ActionType: framework.Add | framework.Update},
{Resource: framework.CSIStorageCapacity, ActionType: framework.Add | framework.Update},
}
return events
}
@@ -379,12 +375,9 @@ func New(plArgs runtime.Object, fh framework.Handle, fts feature.Features) (fram
pvInformer := fh.SharedInformerFactory().Core().V1().PersistentVolumes()
storageClassInformer := fh.SharedInformerFactory().Storage().V1().StorageClasses()
csiNodeInformer := fh.SharedInformerFactory().Storage().V1().CSINodes()
var capacityCheck *CapacityCheck
if fts.EnableCSIStorageCapacity {
capacityCheck = &CapacityCheck{
CSIDriverInformer: fh.SharedInformerFactory().Storage().V1().CSIDrivers(),
CSIStorageCapacityInformer: fh.SharedInformerFactory().Storage().V1beta1().CSIStorageCapacities(),
}
capacityCheck := CapacityCheck{
CSIDriverInformer: fh.SharedInformerFactory().Storage().V1().CSIDrivers(),
CSIStorageCapacityInformer: fh.SharedInformerFactory().Storage().V1().CSIStorageCapacities(),
}
binder := NewVolumeBinder(fh.ClientSet(), podInformer, nodeInformer, csiNodeInformer, pvcInformer, pvInformer, storageClassInformer, capacityCheck, time.Duration(args.BindTimeoutSeconds)*time.Second)