From 09298dd83f200b9c9d89750492733acc7fdc98c4 Mon Sep 17 00:00:00 2001 From: pacoxu Date: Mon, 8 Mar 2021 18:38:29 +0800 Subject: [PATCH] implement EnqueueExtensions interface in taint toleration scheduling Signed-off-by: pacoxu Co-authored-by: Wei Huang --- .../plugins/tainttoleration/taint_toleration.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go index b60e1ea9dc1..edf65c48ae7 100644 --- a/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go +++ b/pkg/scheduler/framework/plugins/tainttoleration/taint_toleration.go @@ -35,6 +35,7 @@ type TaintToleration struct { var _ framework.FilterPlugin = &TaintToleration{} var _ framework.PreScorePlugin = &TaintToleration{} var _ framework.ScorePlugin = &TaintToleration{} +var _ framework.EnqueueExtensions = &TaintToleration{} const ( // 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 } +// 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. func (pl *TaintToleration) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { if nodeInfo == nil || nodeInfo.Node() == nil {