Open hiddeco opened 1 week ago
Oh cool, I didn't realize this was a thing. Reminds me of https://github.com/expr-lang/expr.
This will help us in the long run, but it'll take a long time before users will be 1.29+, so we'll need to wait a while before considering switching fully to this. But that isn't to say we shouldn't just add the markers preemptively.
It's worth noting that beta support was already added in 1.25, which means pretty much all newer versions offer support for it.
In Kubernetes 1.29, Common Expression Language validation rules were promoted to GA.
Using CEL, writing complex validation rules without needing validation webhooks and/or custom Go code is possible using the
+kubebuilder:validation:XValidation
marker. As this can potentially reduce the custom logic we have at the moment (but not all), it may be worth looking into.