diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go b/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go index 11e345f4e2d..2d6aa94d6b1 100644 --- a/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go +++ b/pkg/scheduler/framework/plugins/nodevolumelimits/csi.go @@ -57,6 +57,7 @@ type CSILimits struct { } var _ framework.FilterPlugin = &CSILimits{} +var _ framework.EnqueueExtensions = &CSILimits{} // CSIName is the name of the plugin used in the plugin registry and configurations. const CSIName = "NodeVolumeLimits" @@ -66,6 +67,15 @@ func (pl *CSILimits) Name() string { return CSIName } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *CSILimits) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.CSINode, ActionType: framework.Add}, + {Resource: framework.Pod, ActionType: framework.Delete}, + } +} + // Filter invoked at the filter extension point. func (pl *CSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { // If the new pod doesn't have any volume attached to it, the predicate will always be true diff --git a/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go b/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go index ce268d77457..cbc622abe64 100644 --- a/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go +++ b/pkg/scheduler/framework/plugins/nodevolumelimits/non_csi.go @@ -119,6 +119,7 @@ type nonCSILimits struct { } var _ framework.FilterPlugin = &nonCSILimits{} +var _ framework.EnqueueExtensions = &nonCSILimits{} // newNonCSILimitsWithInformerFactory returns a plugin with filter name and informer factory. func newNonCSILimitsWithInformerFactory( @@ -195,6 +196,15 @@ func (pl *nonCSILimits) Name() string { return pl.name } +// EventsToRegister returns the possible events that may make a Pod +// failed by this plugin schedulable. +func (pl *nonCSILimits) EventsToRegister() []framework.ClusterEvent { + return []framework.ClusterEvent{ + {Resource: framework.Node, ActionType: framework.Add}, + {Resource: framework.Pod, ActionType: framework.Delete}, + } +} + // Filter invoked at the filter extension point. func (pl *nonCSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { // If a pod doesn't have any volume attached to it, the predicate will always be true.