- Notifications
You must be signed in to change notification settings - Fork 67
Description
When I did the kubectl delete -f examples/my-hotel-gateway-tls.yaml, since the my-hotel-gateway has httproutes that reference it, this gateway cannot be deleted as expected. but one not good user experience is: after I type kubectl delete -f examples/my-hotel-gateway-tls.yaml and press enter, the terminal get stuck (Have to press “control+C” to exit it) and don't have any hint, It will be better if it can return and give a hint "this gateway has dependencies, it cannot be deleted".
And after I press “control+C”, I think the cluster or controller shift into a "bad state", If I hope to update the my-hotel-gateway config again by kubectl apply -f examples/my-hotel-gateway-tls.yaml, it will refuse to apply this update:
kubectl apply -f examples/my-hotel-gateway-tls.yaml Warning: Detected changes to resource my-hotel which is currently being deleted. [gateway.gateway.networking.k8s.io/my-hotel](http://gateway.gateway.networking.k8s.io/my-hotel) configured The new config didn't take effect:
The controller log shows:
2023-04-17T17:02:42-07:00 INFO GatewayReconciler {“controller”: “gateway”, “controllerGroup”: “[gateway.networking.k8s.io](http://gateway.networking.k8s.io/)”, “controllerKind”: “Gateway”, “Gateway”: {“name”:“my-hotel”,“namespace”:“default”}, “namespace”: “default”, “name”: “my-hotel”, “reconcileID”: “72696f67-e16c-485c-86cf-2b9e0a5e5685”} 2023-04-17T17:02:42-07:00 INFO Can not delete because it is referenced by some HTTPRoutes {“controller”: “gateway”, “controllerGroup”: “[gateway.networking.k8s.io](http://gateway.networking.k8s.io/)”, “controllerKind”: “Gateway”, “Gateway”: {“name”:“my-hotel”,“namespace”:“default”}, “namespace”: “default”, “name”: “my-hotel”, “reconcileID”: “72696f67-e16c-485c-86cf-2b9e0a5e5685"} I have to delete ALL HTTPRoutes referencing this gateway to solve the issue, then kubectl apply -f examples/my-hotel-gateway-tls.yaml could take effect, this user experience is not good for me.
One behavior that I think is better:
After user doing kubectl delete -f examples/my-hotel-gateway-tls.yaml, if the controller detect it has HTTPRoute refering it, kubectl could return "this gateway has dependencies, it cannot be deleted", while the controller should completely don't start the deleting gateway reconciling process i.e., Controller should not retry on deleting a gateway that it has dependencies. The whole cluster just discard this one deleting gateway event and immediately told the user "this gateway has dependencies, it cannot be deleted"