Merge pull request #83601 from ahg-g/ahg-migration-priority
Implemented taints and tolerations priority function as a Score plugin
This commit is contained in:
@@ -148,17 +148,17 @@ func (sp *ScorePlugin) reset() {
|
||||
}
|
||||
|
||||
// Score returns the score of scheduling a pod on a specific node.
|
||||
func (sp *ScorePlugin) Score(state *framework.CycleState, p *v1.Pod, nodeName string) (int, *framework.Status) {
|
||||
func (sp *ScorePlugin) Score(state *framework.CycleState, p *v1.Pod, nodeName string) (int64, *framework.Status) {
|
||||
sp.numScoreCalled++
|
||||
if sp.failScore {
|
||||
return 0, framework.NewStatus(framework.Error, fmt.Sprintf("injecting failure for pod %v", p.Name))
|
||||
}
|
||||
|
||||
score := 1
|
||||
score := int64(1)
|
||||
if sp.numScoreCalled == 1 {
|
||||
// The first node is scored the highest, the rest is scored lower.
|
||||
sp.highScoreNode = nodeName
|
||||
score = int(framework.MaxNodeScore)
|
||||
score = framework.MaxNodeScore
|
||||
}
|
||||
return score, nil
|
||||
}
|
||||
@@ -179,9 +179,9 @@ func (sp *ScoreWithNormalizePlugin) reset() {
|
||||
}
|
||||
|
||||
// Score returns the score of scheduling a pod on a specific node.
|
||||
func (sp *ScoreWithNormalizePlugin) Score(state *framework.CycleState, p *v1.Pod, nodeName string) (int, *framework.Status) {
|
||||
func (sp *ScoreWithNormalizePlugin) Score(state *framework.CycleState, p *v1.Pod, nodeName string) (int64, *framework.Status) {
|
||||
sp.numScoreCalled++
|
||||
score := 10
|
||||
score := int64(10)
|
||||
return score, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user