// NewMizarServiceController starts mizar service controller
NewMizarServiceController starts mizar service controller
// NewMizarServiceController starts mizar service controller
func NewMizarServiceController(kubeClientset *kubernetes.Clientset, netClient arktos.Interface, serviceInformer coreinformers.ServiceInformer, arktosNetworkInformer arktosinformer.NetworkInformer, grpcHost string, grpcAdaptor IGrpcAdaptor) *MizarServiceController {
	eventBroadcaster := record.NewBroadcaster()
	eventBroadcaster.StartLogging(klog.Infof)
	eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: kubeClientset.CoreV1().EventsWithMultiTenancy(metav1.NamespaceAll, metav1.TenantAll)})
	c := &MizarServiceController{
		kubeClientset:       kubeClientset,
		netClient:           netClient,
		serviceLister:       serviceInformer.Lister(),
		serviceListerSynced: serviceInformer.Informer().HasSynced,
		networkLister:       arktosNetworkInformer.Lister(),
		networkListerSynced: arktosNetworkInformer.Informer().HasSynced,
		queue:               workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),
		recorder:            eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "mizar-service-controller"}),
		grpcHost:            grpcHost,
		grpcAdaptor:         grpcAdaptor,
	}
	serviceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    c.createService,
		UpdateFunc: c.updateService,
		DeleteFunc: c.deleteService,
	})
	c.serviceLister = serviceInformer.Lister()
	c.serviceListerSynced = serviceInformer.Informer().HasSynced
	c.syncHandler = c.syncService
	return c
}
func NewMizarServiceController ( kubeClientset * kubernetes . Clientset , netClient arktos . Interface , serviceInformer coreinformers . ServiceInformer , arktosNetworkInformer arktosinformer . NetworkInformer , grpcHost string , grpcAdaptor IGrpcAdaptor ) * MizarServiceController { eventBroadcaster := record . NewBroadcaster ( ) eventBroadcaster . StartLogging ( klog . Infof ) eventBroadcaster . StartRecordingToSink ( & v1core . EventSinkImpl { Interface : kubeClientset . CoreV1 ( ) . EventsWithMultiTenancy ( metav1 . NamespaceAll , metav1 . TenantAll ) } ) c := & MizarServiceController { kubeClientset : kubeClientset , netClient : netClient , serviceLister : serviceInformer . Lister ( ) , serviceListerSynced : serviceInformer . Informer ( ) . HasSynced , networkLister : arktosNetworkInformer . Lister ( ) , networkListerSynced : arktosNetworkInformer . Informer ( ) . HasSynced , queue : workqueue . NewRateLimitingQueue ( workqueue . DefaultControllerRateLimiter ( ) ) , recorder : eventBroadcaster . NewRecorder ( scheme . Scheme , v1 . EventSource { Component : " " } ) , grpcHost : grpcHost , grpcAdaptor : grpcAdaptor , } serviceInformer . Informer ( ) . AddEventHandler ( cache . ResourceEventHandlerFuncs { AddFunc : c . createService , UpdateFunc : c . updateService , DeleteFunc : c . deleteService , } ) c . serviceLister = serviceInformer . Lister ( ) c . serviceListerSynced = serviceInformer . Informer ( ) . HasSynced c . syncHandler = c . syncService return c }
NewMizarServiceController starts mizar service controller
NewMizarServiceController starts mizar service controller