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/05 08:20:18 UTC

[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1394: fix: ingresstlssecretnotfound

AlinsRan commented on code in PR #1394:
URL: https://github.com/apache/apisix-ingress-controller/pull/1394#discussion_r1039278171


##########
pkg/providers/controller.go:
##########
@@ -262,6 +262,16 @@ func (c *Controller) initSharedInformers() *providertypes.ListerInformer {
 		ConfigMapLister:        configmapLister,
 	}
 
+	//wait for all informer has synecd
+	apisixFactory.Start(ctx.Done())
+	kubeFactory.Start(ctx.Done())
+	cache.WaitForCacheSync(ctx.Done(),
+		listerInformer.EpInformer.HasSynced,
+		listerInformer.SvcInformer.HasSynced,
+		listerInformer.SecretInformer.HasSynced,
+		listerInformer.PodInformer.HasSynced,
+		listerInformer.ApisixUpstreamInformer.HasSynced)
+

Review Comment:
   It is wrong to start here, because the event handler function is not registered before starting, which will cause some events to be lost.



##########
pkg/providers/controller.go:
##########
@@ -262,6 +262,16 @@ func (c *Controller) initSharedInformers() *providertypes.ListerInformer {
 		ConfigMapLister:        configmapLister,
 	}
 
+	//wait for all informer has synecd
+	apisixFactory.Start(ctx.Done())
+	kubeFactory.Start(ctx.Done())
+	cache.WaitForCacheSync(ctx.Done(),
+		listerInformer.EpInformer.HasSynced,
+		listerInformer.SvcInformer.HasSynced,
+		listerInformer.SecretInformer.HasSynced,
+		listerInformer.PodInformer.HasSynced,
+		listerInformer.ApisixUpstreamInformer.HasSynced)
+

Review Comment:
   `apisixFactory.Start(ctx.Done())` 
   why is it needed?



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