fix(nodepool-controller): write a fractional fair-share window size as a Prometheus duration #214
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 358 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.352
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #214"
general
weight: 0.35
blacksoxx
Description
The NodePool CRD admits a fair-share window size with a fraction or with units in
any order (
1.5d,0.5d,2.5h,30m2h). Its pattern is^(0|([0-9]+(\.[0-9]+)?(m|h|d))+)$.The controller copies that string unchanged into the SchedulingShard's
usageParams.windowSize. That field is a Prometheus duration: whole numbers,units largest first. The SchedulingShard CRD pattern rejects these values, so
the API server refuses the shard write. Following the reconcile code, a new node
pool then stays
Unschedulablewith only the generic scheduler-not-ready message,and an existing pool's shard stops taking updates. I have not run this on a
cluster; the rejection itself is shown below with the API server's schema
validator.
parseMonitoringDurationParamnow behaves as follows:7d,14d,168h) is kept as written.str2durationcan read is converted withmodel.Duration; KAIScheduler reads this field with
model.ParseDuration.1.5dbecomes1d12h, and30m2hbecomes
2h30m.github.com/prometheus/commonwas already in the module graph. It moves from anindirect to a direct requirement.
Related issues
None.
Checklist
make validate(mod-check, license-check, header-format-check, notice-check, sync-crds-check and crd-rbac-check pass, as dogofmtandgo vet; I could not run the lint and scc-check targets locally)Breaking changes
None. Window sizes that were already valid Prometheus durations are written
unchanged.
Additional notes
Tests:
1.5dmust give1d12h, and30m2hmust give2h30m. Both fail on main, where the shardreceives
1.5dand30m2h, and pass with this change.14d,168hand invalid-value cases are unchanged and still pass.go test ./pkg/... ./cmd/...passes.I also validated the shard the controller builds against the pinned
SchedulingShard CRD (
github.com/kai-scheduler/api@v0.1.4), using the APIserver's schema validator from
k8s.io/apiextensions-apiserver:1.5d,0.5d,2.5hand12h1dwere rejected.model.ParseDuration.This change was drafted with Claude Code (claude-opus-5-5); the test results above are from the runs described.