tokers commented on a change in pull request #593:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/593#discussion_r700965087



##########
File path: pkg/ingress/apisix_route.go
##########
@@ -292,6 +292,26 @@ func (c *apisixRouteController) handleSyncErr(obj 
interface{}, errOrigin error)
        c.workqueue.AddRateLimited(obj)
 }
 
+func (c *apisixRouteController) isApisixRouteEffective(ar kube.ApisixRoute) 
bool {
+       var class string
+
+       if ar.GroupVersion() == kube.ApisixRouteV1 {
+               class = ar.V1().Spec.IngressClassName
+       } else if ar.GroupVersion() == kube.ApisixRouteV2alpha1 {
+               class = ar.V2alpha1().Spec.IngressClassName
+       } else if ar.GroupVersion() == kube.ApisixRouteV2beta1 {
+               class = ar.V2beta1().Spec.IngressClassName
+       } else {
+               class = c.controller.cfg.Kubernetes.IngressClass

Review comment:
       Actually the else won't be entered, once the logic here was executed, 
then there are some programming faults occurred, we may just:
   
   1. Panic, or
   2. log the error and just return false.




-- 
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