mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #100026 from minbaev/enqueue-extions-to-nvl
add enqueue-extensions nodevolumelimits plugin
This commit is contained in:
commit
5cdf7a714f
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user