mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
added eventsToRegister for nodeName & nodeUnschedulable plugins
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
This commit is contained in:
parent
5ae856c36f
commit
31b79f481e
@ -28,6 +28,7 @@ import (
|
|||||||
type NodeName struct{}
|
type NodeName struct{}
|
||||||
|
|
||||||
var _ framework.FilterPlugin = &NodeName{}
|
var _ framework.FilterPlugin = &NodeName{}
|
||||||
|
var _ framework.EnqueueExtensions = &NodeName{}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Name is the name of the plugin used in the plugin registry and configurations.
|
// Name is the name of the plugin used in the plugin registry and configurations.
|
||||||
@ -37,6 +38,14 @@ const (
|
|||||||
ErrReason = "node(s) didn't match the requested node name"
|
ErrReason = "node(s) didn't match the requested node name"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventsToRegister returns the possible events that may make a Pod
|
||||||
|
// failed by this plugin schedulable.
|
||||||
|
func (pl *NodeName) EventsToRegister() []framework.ClusterEvent {
|
||||||
|
return []framework.ClusterEvent{
|
||||||
|
{Resource: framework.Node, ActionType: framework.Add},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Name returns name of the plugin. It is used in logs, etc.
|
// Name returns name of the plugin. It is used in logs, etc.
|
||||||
func (pl *NodeName) Name() string {
|
func (pl *NodeName) Name() string {
|
||||||
return Name
|
return Name
|
||||||
|
@ -31,6 +31,7 @@ type NodeUnschedulable struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var _ framework.FilterPlugin = &NodeUnschedulable{}
|
var _ framework.FilterPlugin = &NodeUnschedulable{}
|
||||||
|
var _ framework.EnqueueExtensions = &NodeUnschedulable{}
|
||||||
|
|
||||||
// Name is the name of the plugin used in the plugin registry and configurations.
|
// Name is the name of the plugin used in the plugin registry and configurations.
|
||||||
const Name = "NodeUnschedulable"
|
const Name = "NodeUnschedulable"
|
||||||
@ -42,6 +43,14 @@ const (
|
|||||||
ErrReasonUnschedulable = "node(s) were unschedulable"
|
ErrReasonUnschedulable = "node(s) were unschedulable"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EventsToRegister returns the possible events that may make a Pod
|
||||||
|
// failed by this plugin schedulable.
|
||||||
|
func (pl *NodeUnschedulable) EventsToRegister() []framework.ClusterEvent {
|
||||||
|
return []framework.ClusterEvent{
|
||||||
|
{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeTaint},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Name returns name of the plugin. It is used in logs, etc.
|
// Name returns name of the plugin. It is used in logs, etc.
|
||||||
func (pl *NodeUnschedulable) Name() string {
|
func (pl *NodeUnschedulable) Name() string {
|
||||||
return Name
|
return Name
|
||||||
|
Loading…
Reference in New Issue
Block a user