FIREcup commented on issue #13193:
URL: https://github.com/apache/apisix/issues/13193#issuecomment-4213340741

   The AI ​​analysis suggests that the GRPCRoute resource appears to be not 
being processed correctly:
   GatewayReconciler unconditionally watches GRPCRoute.
   
   File: 
`[internal/controller/gateway_controller.go](https://github.com/apache/apisix-ingress-controller/blob/2.0.1/internal/controller/gateway_controller.go)`
   
   The SetupWithManager() function contains this:
   
   ```
   bdr := ctrl.NewControllerManagedBy(mgr).
   
   For(&gatewayv1.Gateway{}, ...).
   
   Watches(&gatewayv1.GatewayClass{}, ...).
   
   Watches(&gatewayv1.HTTPRoute{}, ...).
   
   Watches(&gatewayv1.GRPCRoute{}, ...).
   
   Watches(&v1alpha1.GatewayProxy{}, ...).
   
   Watches(&corev1.Secret{}, ...)
   ```
   
   Here, both HTTPRoute and GRPCRoute are unconditionally watched (...).
   
   The existence checks are only performed on the following:
   
   ```
   if pkgutils.HasAPIResource(mgr, &gatewayv1alpha2.TCPRoute{}) { ... }
   
   if pkgutils.HasAPIResource(mgr, &gatewayv1alpha2.TLSRoute{}) { ... }
   
   if pkgutils.HasAPIResource(mgr, &gatewayv1alpha2.UDPRoute{}) { ... }
   ```
   
   In other words:
   
   - TCPRoute / TLSRoute / UDPRoute are protected
   
   - GRPCRoute is not protected


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to