kubernetes-sigs / gateway-api

Repository for the next iteration of composite service (e.g. Ingress) and load balancing APIs.
https://gateway-api.sigs.k8s.io
Apache License 2.0
1.86k stars 482 forks source link

HTTPRoute BacknedRefs validation and potentially inconsistent view when backend is removed. #3433

Open dawid-nowak opened 3 weeks ago

dawid-nowak commented 3 weeks ago

I think a following scenario would need to be validated with respect to HTTPRoute and BackendRefs. The documentation is very vague here what should happen here.

  1. We add a HTTPRoute with valid BackendRefs, everything is good and the tests are passing.
  2. We remove the backend/object referenced by BackendRefs. The route is now invalid but it will not be updated since we would need to register for notifications about the removal of the referenced object.
  3. Which leaves the gateway in an inconsistent state.

Alternatively, we should drop validation of BackendRefs. So then the conditions don't need to be updated and the gateway doesn't care if the backend exists or it doesn't exist.