kyma
kyma copied to clipboard
Validation and Defaulting webhook for eventing subscription CR
Description
Write a validation webhook for the eventing Subscription.
Tasks:
- [ ] Add Defaulting webhook
- [ ] Add validation of the event-types
- [ ] Add validation of the event-source
- [ ] Add validation if there are duplicate event types or no event types
- [ ] Add validation of the sink
- [ ] Remove the validation from the Reconcile() and rely on the validation webhook.
AC
- [ ] Webhook is scaffolded (tip: use kubebuilder for this)
- [ ] Reject a Subscription with an invalid event-type/source/sink.
Reasons
The reason why we need a webhook is to fail-fast and provide the user with direct feedback about what is wrong in the Subscription
. This will also make the controllers easier and slimmer as the validation part is moved to the validation webhook.
Hints/Dependencies
- There is already a POC for a mutating webhook. You can reuse this and concentrate on implementing the validation :)
- It probably make sense to implement event-type validation and the sink validation in separate tickets/PRs.
This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. Thank you for your contributions.
- We should only write the validation webhook for the new subscription CRD version
The issue will be addressed in 3 steps:
- Creating Validation and Mutating webhook resources and writing validations for event source and types: https://github.com/kyma-project/kyma/pull/16049
- writing validation logic for sink: https://github.com/kyma-project/kyma/pull/16066
- Integration tests: https://github.com/kyma-project/kyma/issues/16055