func NewController(
	opt reconciler.Options,
	clusterIngressInformer informers.ClusterIngressInformer,
	virtualServiceInformer istioinformers.VirtualServiceInformer,
	gatewayInformer istioinformers.GatewayInformer,
) *controller.Impl {

	c := &Reconciler{
		Base:                     reconciler.NewBase(opt, controllerAgentName),
		clusterIngressLister:     clusterIngressInformer.Lister(),
		virtualServiceLister:     virtualServiceInformer.Lister(),
		gatewayLister:            gatewayInformer.Lister(),
		enableReconcilingGateway: false,
	}
	impl := controller.NewImpl(c, c.Logger, "ClusterIngresses", reconciler.MustNewStatsReporter("ClusterIngress", c.Logger))

	c.Logger.Info("Setting up event handlers")
	myFilterFunc := reconciler.AnnotationFilterFunc(networking.IngressClassAnnotationKey, network.IstioIngressClassName, true)
	clusterIngressInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
		FilterFunc: myFilterFunc,
		Handler: cache.ResourceEventHandlerFuncs{
			AddFunc:    impl.Enqueue,
			UpdateFunc: controller.PassNew(impl.Enqueue),
			DeleteFunc: impl.Enqueue,
		},
	})

	virtualServiceInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
		FilterFunc: myFilterFunc,
		Handler: cache.ResourceEventHandlerFuncs{
			AddFunc:    impl.EnqueueLabelOfClusterScopedResource(networking.IngressLabelKey),
			UpdateFunc: controller.PassNew(impl.EnqueueLabelOfClusterScopedResource(networking.IngressLabelKey)),
			DeleteFunc: impl.EnqueueLabelOfClusterScopedResource(networking.IngressLabelKey),
		},
	})

	c.Logger.Info("Setting up ConfigMap receivers")
	resyncIngressesOnIstioConfigChange := configmap.TypeFilter(&config.Istio{})(func(string, interface{}) {
		impl.GlobalResync(clusterIngressInformer.Informer())
	})
	c.configStore = config.NewStore(c.Logger.Named("config-store"), resyncIngressesOnIstioConfigChange)
	c.configStore.WatchConfigs(opt.ConfigMapWatcher)
	return impl
}
// NewController initializes the controller and is called by the generated code
// Registers eventhandlers to enqueue events.
NewController initializes the controller and is called by the generated code
Registers eventhandlers to enqueue events.
// NewController initializes the controller and is called by the generated code // Registers eventhandlers to enqueue events .
func NewController(
	opt reconciler.Options,
	clusterIngressInformer informers.ClusterIngressInformer,
	virtualServiceInformer istioinformers.VirtualServiceInformer,
	gatewayInformer istioinformers.GatewayInformer,
) *controller.Impl {
	c := &Reconciler{
		Base:                     reconciler.NewBase(opt, controllerAgentName),
		clusterIngressLister:     clusterIngressInformer.Lister(),
		virtualServiceLister:     virtualServiceInformer.Lister(),
		gatewayLister:            gatewayInformer.Lister(),
		enableReconcilingGateway: false,
	}
	impl := controller.NewImpl(c, c.Logger, "ClusterIngresses", reconciler.MustNewStatsReporter("ClusterIngress", c.Logger))
	c.Logger.Info("Setting up event handlers")
	myFilterFunc := reconciler.AnnotationFilterFunc(networking.IngressClassAnnotationKey, network.IstioIngressClassName, true)
	clusterIngressInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
		FilterFunc: myFilterFunc,
		Handler: cache.ResourceEventHandlerFuncs{
			AddFunc:    impl.Enqueue,
			UpdateFunc: controller.PassNew(impl.Enqueue),
			DeleteFunc: impl.Enqueue,
		},
	})
	virtualServiceInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
		FilterFunc: myFilterFunc,
		Handler: cache.ResourceEventHandlerFuncs{
			AddFunc:    impl.EnqueueLabelOfClusterScopedResource(networking.IngressLabelKey),
			UpdateFunc: controller.PassNew(impl.EnqueueLabelOfClusterScopedResource(networking.IngressLabelKey)),
			DeleteFunc: impl.EnqueueLabelOfClusterScopedResource(networking.IngressLabelKey),
		},
	})
	c.Logger.Info("Setting up ConfigMap receivers")
	resyncIngressesOnIstioConfigChange := configmap.TypeFilter(&config.Istio{})(func(string, interface{}) {
		impl.GlobalResync(clusterIngressInformer.Informer())
	})
	c.configStore = config.NewStore(c.Logger.Named("config-store"), resyncIngressesOnIstioConfigChange)
	c.configStore.WatchConfigs(opt.ConfigMapWatcher)
	return impl
}
func NewController ( opt reconciler . Options , clusterIngressInformer informers . ClusterIngressInformer , virtualServiceInformer istioinformers . VirtualServiceInformer , gatewayInformer istioinformers . GatewayInformer , ) * controller . Impl { c := & Reconciler { Base : reconciler . NewBase ( opt , controllerAgentName ) , clusterIngressLister : clusterIngressInformer . Lister ( ) , virtualServiceLister : virtualServiceInformer . Lister ( ) , gatewayLister : gatewayInformer . Lister ( ) , enableReconcilingGateway : false , } impl := controller . NewImpl ( c , c . Logger , " " , reconciler . MustNewStatsReporter ( " " , c . Logger ) ) c . Logger . Info ( " " ) myFilterFunc := reconciler . AnnotationFilterFunc ( networking . IngressClassAnnotationKey , network . IstioIngressClassName , true ) clusterIngressInformer . Informer ( ) . AddEventHandler ( cache . FilteringResourceEventHandler { FilterFunc : myFilterFunc , Handler : cache . ResourceEventHandlerFuncs { AddFunc : impl . Enqueue , UpdateFunc : controller . PassNew ( impl . Enqueue ) , DeleteFunc : impl . Enqueue , } , } ) virtualServiceInformer . Informer ( ) . AddEventHandler ( cache . FilteringResourceEventHandler { FilterFunc : myFilterFunc , Handler : cache . ResourceEventHandlerFuncs { AddFunc : impl . EnqueueLabelOfClusterScopedResource ( networking . IngressLabelKey ) , UpdateFunc : controller . PassNew ( impl . EnqueueLabelOfClusterScopedResource ( networking . IngressLabelKey ) ) , DeleteFunc : impl . EnqueueLabelOfClusterScopedResource ( networking . IngressLabelKey ) , } , } ) c . Logger . Info ( " " ) resyncIngressesOnIstioConfigChange := configmap . TypeFilter ( & config . Istio { } ) ( func ( string , interface { } ) { impl . GlobalResync ( clusterIngressInformer . Informer ( ) ) } ) c . configStore = config . NewStore ( c . Logger . Named ( " " ) , resyncIngressesOnIstioConfigChange ) c . configStore . WatchConfigs ( opt . ConfigMapWatcher ) return impl }
NewController initializes the controller and is called by the generated code
Registers eventhandlers to enqueue events.
NewController initializes the controller and is called by the generated code Registers eventhandlers to enqueue events .