fix(api): avoid indexing split() in taint CEL rules for K8s 1.38 cost estimation #505
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.62) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 262 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.333
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #505"
general
weight: 0.35
Karthik-K-N
Description
Kubernetes 1.38 upgraded
cel-goto v0.33.0, which stops appending@itemsto the AST path of list indexing expressions when the receiver has an empty path (such asself.key.split('/')). Because Kubernetes's CEL cost estimator returnsElem: nilin theResultSizeofsplit(), indexingself.key.split('/')[1]receivesUnknownSizeEstimate()(MaxUint64), causing.matches()on the indexed element to exceed the CRD validation cost limit (18446744073709551615 > 10000000) and rejectingNodeReadinessRuleCRD creation on 1.38kube-apiserver.Since the preceding rules on
spec.taintalready verify thatself.key.startsWith('readiness.k8s.io/')(17 characters) andsize(self.key.split('/')) == 2, validate the name part length (self.key.size() >= 18 && self.key.size() <= 80) and character set (self.key.matches('^readiness[.]k8s[.]io/[A-Za-z0-9]([-A-Za-z0-9_.][A-Za-z0-9])?$')) directly onself.key. This brings the rule costs down to8and5,033,170(10,380,974total acrossspec.taint) and passes Kubernetes 1.38 CRD validation.Related Issue
None
Type of Change
/kind bug
/kind api-change
Testing
config/crd/bases/readiness.node.x-k8s.io_nodereadinessrules.yamlagainst Kubernetes 1.38validation.ValidateCustomResourceDefinition(cel-gov0.33.2): 0 validation errors,spec.tainttotal static estimated cost10,380,974(limit100,000,000).make test,make lint, andmake verify.Checklist
make testpassesmake lintpassesDoes this PR introduce a user-facing change?
``
release-note
`Fix NodeReadinessRule CRD CEL validation cost overflow on Kubernetes 1.38+ apiservers
No AI tools were used
AI tools were used (complete below) cel-goGenerative AI Usage Disclosure
How they were used:*
An AI coding agent diagnosed the
v0.33.0 cost estimation change inapi/v1alpha1/nodereadinessrule_types.go, regenerated the CRD manifests, and verified the CRD against Kubernetes 1.38'sValidateCustomResourceDefinition`. I reviewed the changes.