Merge pull request #100026 from minbaev/enqueue-extions-to-nvl
add enqueue-extensions nodevolumelimits plugin
This commit is contained in:
		@@ -57,6 +57,7 @@ type CSILimits struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var _ framework.FilterPlugin = &CSILimits{}
 | 
					var _ framework.FilterPlugin = &CSILimits{}
 | 
				
			||||||
 | 
					var _ framework.EnqueueExtensions = &CSILimits{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// CSIName is the name of the plugin used in the plugin registry and configurations.
 | 
					// CSIName is the name of the plugin used in the plugin registry and configurations.
 | 
				
			||||||
const CSIName = "NodeVolumeLimits"
 | 
					const CSIName = "NodeVolumeLimits"
 | 
				
			||||||
@@ -66,6 +67,15 @@ func (pl *CSILimits) Name() string {
 | 
				
			|||||||
	return CSIName
 | 
						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.
 | 
					// Filter invoked at the filter extension point.
 | 
				
			||||||
func (pl *CSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
 | 
					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
 | 
						// If the new pod doesn't have any volume attached to it, the predicate will always be true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -119,6 +119,7 @@ type nonCSILimits struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var _ framework.FilterPlugin = &nonCSILimits{}
 | 
					var _ framework.FilterPlugin = &nonCSILimits{}
 | 
				
			||||||
 | 
					var _ framework.EnqueueExtensions = &nonCSILimits{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// newNonCSILimitsWithInformerFactory returns a plugin with filter name and informer factory.
 | 
					// newNonCSILimitsWithInformerFactory returns a plugin with filter name and informer factory.
 | 
				
			||||||
func newNonCSILimitsWithInformerFactory(
 | 
					func newNonCSILimitsWithInformerFactory(
 | 
				
			||||||
@@ -195,6 +196,15 @@ func (pl *nonCSILimits) Name() string {
 | 
				
			|||||||
	return pl.name
 | 
						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.
 | 
					// Filter invoked at the filter extension point.
 | 
				
			||||||
func (pl *nonCSILimits) Filter(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
 | 
					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.
 | 
						// If a pod doesn't have any volume attached to it, the predicate will always be true.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user