GoogleCloudPlatform / prometheus-engine

Google Cloud Managed Service for Prometheus libraries and manifests.
https://g.co/cloud/managedprometheus
Apache License 2.0
196 stars 92 forks source link

Using CRD validation rules for field validation #1156

Open cici37 opened 2 months ago

cici37 commented 2 months ago

Hi prometheus community,

CRD, as the most popular extension point of Kubernetes, is used heavily in prometheus project. I would like to mention that Kubernetes is now supporting CRD validation rules for more complicated field validation logic.

It would help not only shifting the validation check left to catch the issue early but also significantly reduced the usage of webhooks(even possibly replace the Webhook if the validation logic not involve external dependencies). Additional, it is also supported in kubebuild with a simple marker like // +kubebuilder:validation:XValidation:rule="the validation logic".

I am writing to see if the community would be interested in this feature and please feel free to share the thoughts. Thank you!