INNER CODE UNIT · Go

startInformers

fluxcd/flagger · cmd/flagger/main.go:299

func startInformers(flaggerClient clientset.Interface, logger *zap.SugaredLogger, stopCh <-chan struct{}) controller.Informers {
	flaggerInformerFactory := informers.NewSharedInformerFactoryWithOptions(flaggerClient, time.Second*30, informers.WithNamespace(namespace))

	logger.Info("Waiting for canary informer cache to sync")
	canaryInformer := flaggerInformerFactory.Flagger().V1beta1().Canaries()
	go canaryInformer.Informer().Run(stopCh)
	if ok := cache.WaitForNamedCacheSync("flagger", stopCh, canaryInformer.Informer().HasSynced); !ok {
		logger.Fatalf("failed to wait for cache to sync")
	}

	logger.Info("Waiting for metric template informer cache to sync")
	metricInformer := flaggerInformerFactory.Flagger().V1beta1().MetricTemplates()
	go metricInformer.Informer().Run(stopCh)
	if ok := cache.WaitForNamedCacheSync("flagger", stopCh, metricInformer.Informer().HasSynced); !ok {
		logger.Fatalf("failed to wait for cache to sync")
	}

	logger.Info("Waiting for alert provider informer cache to sync")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…