fix(scheduler): flip taint penalty for chained spread node policies #3619
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 284 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.338
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3619"
general
weight: 0.35
moezdil
What type of PR is this?
/kind bug
What this PR does / why we need it:
NodeScore.AddTaintTolerationScorecompared the node policy with"spread"exactly. The node policy annotation also accepts chains such asspread,superpodandsuperpod,spread, andNodeScoreList.Lesssorts those as spread. For those values the PreferNoSchedule penalty was applied the binpack way: the tainted node's score went down, and since spread picks the lowest score, the node with the untolerated taint became the preferred one.This replaces the exact comparison with
NodePolicyUsesSpread(policy), the same change #3410 made inNodeScoreList.Less,OverrideScoreandAddNodeAffinityScorewhen it introduced chained node policies. It also coverssuperpodalone with--node-scheduler-policy=spread, which the sort already treats as spread.Which issue(s) this PR fixes:
Fixes #3618
Special notes for your reviewer:
AddTaintTolerationScorewas added two days earlier in #3469 and was missed.TestAddTaintTolerationScore(spread,superpodandsuperpod,spread). Both fail without the change withscore = -40.000000, want 60.000000. The existing rows, including""behaving as binpack, are unchanged.go test ./pkg/scheduler/policy/ -short --race -count=1,go test ./pkg/scheduler/ -short -count=1, andgolangci-lint run ./pkg/scheduler/policy/...(v2.15.0).AI assistance: I used Claude Code to write the tests only; I reviewed and ran all of it myself.
Does this PR introduce a user-facing change?:
``
release-note
``Fixed the PreferNoSchedule taint score favouring tainted nodes when the node scheduler policy is a chain such as spread,superpod.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Taint-toleration scoring now handles policies that combine spread and superpod consistently, regardless of the order in which those settings are specified. Scores for spread policies continue to apply the spread-specific penalty, while other policies retain their existing scoring behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->