mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Merge pull request #99936 from pacoxu/feature/taint-schedule-plugin
implement EnqueueExtensions interface in taint toleration scheduling
This commit is contained in:
commit
adbf279bf1
@ -35,6 +35,7 @@ type TaintToleration struct {
|
|||||||
var _ framework.FilterPlugin = &TaintToleration{}
|
var _ framework.FilterPlugin = &TaintToleration{}
|
||||||
var _ framework.PreScorePlugin = &TaintToleration{}
|
var _ framework.PreScorePlugin = &TaintToleration{}
|
||||||
var _ framework.ScorePlugin = &TaintToleration{}
|
var _ framework.ScorePlugin = &TaintToleration{}
|
||||||
|
var _ framework.EnqueueExtensions = &TaintToleration{}
|
||||||
|
|
||||||
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.
|
||||||
@ -50,6 +51,14 @@ func (pl *TaintToleration) Name() string {
|
|||||||
return Name
|
return Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EventsToRegister returns the possible events that may make a Pod
|
||||||
|
// failed by this plugin schedulable.
|
||||||
|
func (f *TaintToleration) EventsToRegister() []framework.ClusterEvent {
|
||||||
|
return []framework.ClusterEvent{
|
||||||
|
{Resource: framework.Node, ActionType: framework.Add | framework.UpdateNodeTaint},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Filter invoked at the filter extension point.
|
// Filter invoked at the filter extension point.
|
||||||
func (pl *TaintToleration) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
|
func (pl *TaintToleration) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status {
|
||||||
if nodeInfo == nil || nodeInfo.Node() == nil {
|
if nodeInfo == nil || nodeInfo.Node() == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user