pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.22k stars 489 forks source link

Generate CRD manifest with more validation schema #3213

Open cvvz opened 3 years ago

cvvz commented 3 years ago

Feature Request

Is your feature request related to a problem? Please describe:

Tidb-operator use code-generator/openapi-gen and to-crdgen to generate CRD manifest automatically, however, the CRDs only support a few validation schema. For example, if I want to validate the properties by regex, I have to code in ValidatingWebhook or validation.go, which actually validates API resources after created in etcd. Describe the feature you'd like:

Generate CRD manifest from go types with more validation schema automatically. Describe alternatives you've considered:

Kubebuilder use controller-tools/controller-gen to generate CRD automatically, which I think could be used to replace code-generator/openapi-gen and to-crdgen. Teachability, Documentation, Adoption, Migration Strategy:

DanielZhangQD commented 3 years ago

@cofyc Do you know more about the controller-tools/controller-gen? What's your suggestion for this?

mianhk commented 2 years ago

/assign