fix: validate taint value format with CEL #469
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 227 lines diff across 2 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.325
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #469"
general
weight: 0.35
Karthik-K-N
Description
The CEL validation rules on
spec.taintvalidated the key format and cappedvaluelength at 63 characters, but did not validate the character set ofvalue. Because the API server enforces label value syntax on node taints ((([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?), a rule with an invalid taint value (such as spaces or invalid punctuation) was admitted at CRD validation, but every subsequent node patch failed withInvalidfrom the API server, landing the node instatus.failedNodeswithEvaluationError. Becausetaint.valueis immutable, the rule could not be repaired in-place and had to be deleted and recreated.This adds a CEL validation rule on
spec.taintmatching the standard Kubernetes label value character set:Empty or omitted values continue to be permitted as before.
Related Issue
Fixes #467
Type of Change
/kind bug
Testing
internal/controller/nodereadinessrule_controller_test.gounderCEL Validation for taint value formatverifying rejection of invalid taint values and acceptance of valid/empty values.test/e2e/taint_validation_test.go.make manifests,make test(exit 0, controller 86.3%), andmake lint(0 issues).This PR was written in part with the assistance of generative AI; the failure was reproduced against envtest and the change was reviewed and tested by hand.
Checklist
make testpassesmake lintpassesDoes this PR introduce a user-facing change?
``
release-note
``Reject NodeReadinessRules with invalid taint values at admission time rather than failing subsequent node patches with API server validation errors.