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 2022/12/02 09:09:44 UTC

[GitHub] [apisix-ingress-controller] shareinto commented on a diff in pull request #1386: fix: many namespace lead to provider stuck

shareinto commented on code in PR #1386:
URL: https://github.com/apache/apisix-ingress-controller/pull/1386#discussion_r1037927349


##########
pkg/providers/apisix/provider_init.go:
##########
@@ -48,23 +48,26 @@ func (p *apisixProvider) Init(ctx context.Context) error {
 		pluginConfigMapA6 = make(map[string]string)
 	)
 
+	p.apisixSharedInformerFactory.Start(ctx.Done())
+	p.apisixSharedInformerFactory.WaitForCacheSync(ctx.Done())
+
 	namespaces := p.namespaceProvider.WatchingNamespaces()
+
 	for _, key := range namespaces {
 		log.Debugf("start to watch namespace: %s", key)
 		wg.Add(1)
 		go func(ns string) {
 			defer wg.Done()
 			// ApisixRoute
-			opts := v1.ListOptions{}
 			switch p.common.Config.Kubernetes.APIVersion {
 			case config.ApisixV2beta3:
-				retRoutes, err := p.common.KubeClient.APISIXClient.ApisixV2beta3().ApisixRoutes(ns).List(ctx, opts)
+				retRoutes, err := p.apisixSharedInformerFactory.Apisix().V2beta3().ApisixRoutes().Lister().ApisixRoutes(ns).List(labels.Nothing())

Review Comment:
   
   Thanks for reminding, I'll fix it as soon as possible



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