← Back to Pull requests

fix(api): avoid indexing split() in taint CEL rules for K8s 1.38 cost estimation #505

Closed
unknown closed this pull request without merging on Nov 13, 2026 07:24 UTC
View on GitHub
unknown unknown commented on Nov 13, 2026 03:32 UTC
Author

Description


Kubernetes 1.38 upgraded cel-go to v0.33.0, which stops appending @items to the AST path of list indexing expressions when the receiver has an empty path (such as self.key.split('/')). Because Kubernetes's CEL cost estimator returns Elem: nil in the ResultSize of split(), indexing self.key.split('/')[1] receives UnknownSizeEstimate() (MaxUint64), causing .matches() on the indexed element to exceed the CRD validation cost limit (18446744073709551615 > 10000000) and rejecting NodeReadinessRule CRD creation on 1.38 kube-apiserver.

Since the preceding rules on spec.taint already verify that self.key.startsWith('readiness.k8s.io/') (17 characters) and size(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 on self.key. This brings the rule costs down to 8 and 5,033,170 (10,380,974 total across spec.taint) and passes Kubernetes 1.38 CRD validation.

Related Issue


None

Type of Change


/kind bug
/kind api-change

Testing


  • Validated the generated config/crd/bases/readiness.node.x-k8s.io_nodereadinessrules.yaml against Kubernetes 1.38 validation.ValidateCustomResourceDefinition (cel-go v0.33.2): 0 validation errors, spec.taint total static estimated cost 10,380,974 (limit 100,000,000).

  • Ran make test, make lint, and make verify.
  • Checklist


  • make test passes

  • make lint passes
  • Does this PR introduce a user-facing change?


    ``release-note
    Fix NodeReadinessRule CRD CEL validation cost overflow on Kubernetes 1.38+ apiservers
    `

    Generative AI Usage Disclosure


  • No AI tools were used

  • AI tools were used (complete below)
  • How they were used:*
    An AI coding agent diagnosed the
    cel-go v0.33.0 cost estimation change in api/v1alpha1/nodereadinessrule_types.go, regenerated the CRD manifests, and verified the CRD against Kubernetes 1.38's ValidateCustomResourceDefinition`. I reviewed the changes.

    Diff: 262 lines (+196 / -66) across 3 files Reviewer: Karthik-K-N Review duration: 231m
    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
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.4% (MEDIUM) · Higher = larger blast radius
    62.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27% · Safe to merge
    27%