opendatahub-io / model-registry-operator

Apache License 2.0
3 stars 17 forks source link

Add support for defaulting and validating webhooks #15

Closed dhirajsb closed 4 days ago

dhirajsb commented 10 months ago

Is your feature request related to a problem? Please describe. Kubernetes supports calling controller webhooks for setting default values and validating custom resources. MR controller should support this feature to improve operator usability.

Describe the solution you'd like Add support for webhooks for defaulting and validation. The webhook config and code has been generated, but not enabled yet. It requires setting certificates using a k8s certificate manager, which needs to be investigated to determine how that will function in odh operator installs.

Describe alternatives you've considered The alternative is to try to set default values and do validation on every reconciliation, which is inefficient.

Additional context See: https://book.kubebuilder.io/cronjob-tutorial/webhook-implementation

dhirajsb commented 4 days ago

Added webhook support and refactored reconcile behavior into the new webhooks.