akuity / kargo

Application lifecycle orchestration
https://kargo.akuity.io/
Apache License 2.0
1.39k stars 114 forks source link

Common Expression Language validation rules to reduce custom logic #2183

Open hiddeco opened 1 week ago

hiddeco commented 1 week ago

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.

jessesuen commented 6 days 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.

hiddeco commented 6 days ago

It's worth noting that beta support was already added in 1.25, which means pretty much all newer versions offer support for it.