Validating webhook for ingress and ingress class#11
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| } | ||
|
|
||
| ingressClass := &networkingv1.IngressClass{} | ||
| // TODO: How do we deal with 404s? The ingress class might be created just moments later. |
There was a problem hiding this comment.
It is not ideal that we do a lookup here that might fail.
Alternatively, we could also check stackit.cloud annotations regardless of the ingress class. However, we can't validate missing required annotations that way.
How to categorize this PR?
/kind enhancement
What this PR does / why we need it:
When the controller receives an invalid object it either needs to discard it or stop reconciliation altogether. A webhook can catch invalid objects during admission.