You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/02 10:43:23 UTC

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #593: feat: make multiple controllers handle different ApisixRoute CRDs #578

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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org