mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-02 02:21:22 +00:00
Define in-tree scheduler plugin names in separate pkg to break a cyclic depednecy when moving plugin defaulting to CC
This commit is contained in:
@@ -26,7 +26,8 @@ import (
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config/validation"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework"
|
||||
pluginhelper "k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/helper"
|
||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/names"
|
||||
)
|
||||
|
||||
// NodeAffinity is a plugin that checks if a pod node selector matches the node label.
|
||||
@@ -44,7 +45,7 @@ var _ framework.EnqueueExtensions = &NodeAffinity{}
|
||||
|
||||
const (
|
||||
// Name is the name of the plugin used in the plugin registry and configurations.
|
||||
Name = "NodeAffinity"
|
||||
Name = names.NodeAffinity
|
||||
|
||||
// preScoreStateKey is the key in CycleState to NodeAffinity pre-computed data for Scoring.
|
||||
preScoreStateKey = "PreScore" + Name
|
||||
@@ -187,7 +188,7 @@ func (pl *NodeAffinity) Score(ctx context.Context, state *framework.CycleState,
|
||||
|
||||
// NormalizeScore invoked after scoring all nodes.
|
||||
func (pl *NodeAffinity) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status {
|
||||
return pluginhelper.DefaultNormalizeScore(framework.MaxNodeScore, false, scores)
|
||||
return helper.DefaultNormalizeScore(framework.MaxNodeScore, false, scores)
|
||||
}
|
||||
|
||||
// ScoreExtensions of the Score plugin.
|
||||
|
||||
Reference in New Issue
Block a user