mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #100004 from KofClubs/implement-EventsToRegister-nodeports
Implemented EnqueueExtensions interface for NodePorts
This commit is contained in:
commit
d0510aae37
@ -30,6 +30,7 @@ type NodePorts struct{}
|
||||
|
||||
var _ framework.PreFilterPlugin = &NodePorts{}
|
||||
var _ framework.FilterPlugin = &NodePorts{}
|
||||
var _ framework.EnqueueExtensions = &NodePorts{}
|
||||
|
||||
const (
|
||||
// Name is the name of the plugin used in the plugin registry and configurations.
|
||||
@ -97,6 +98,16 @@ func getPreFilterState(cycleState *framework.CycleState) (preFilterState, error)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
// EventsToRegister returns the possible events that may make a Pod
|
||||
// failed by this plugin schedulable.
|
||||
func (pl *NodePorts) EventsToRegister() []framework.ClusterEvent {
|
||||
return []framework.ClusterEvent{
|
||||
// Due to immutable fields `spec.containers[*].ports`, pod update events are ignored.
|
||||
{Resource: framework.Pod, ActionType: framework.Delete},
|
||||
{Resource: framework.Node, ActionType: framework.Add},
|
||||
}
|
||||
}
|
||||
|
||||
// Filter invoked at the filter extension point.
|
||||
func (pl *NodePorts) Filter(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
|
||||
wantPorts, err := getPreFilterState(cycleState)
|
||||
|
Loading…
Reference in New Issue
Block a user