code: func NewAutoRegisterController(apiServiceInformer informers.APIServiceInformer, apiServiceClient apiregistrationclient.APIServicesGetter) *autoRegisterController {
  	c := &autoRegisterController{
  		apiServiceLister:  apiServiceInformer.Lister(),
  		apiServiceSynced:  apiServiceInformer.Informer().HasSynced,
  		apiServiceClient:  apiServiceClient,
  		apiServicesToSync: map[string]*apiregistration.APIService{},
  
  		apiServicesAtStart: map[string]bool{},
  
  		syncedSuccessfullyLock: &sync.RWMutex{},
  		syncedSuccessfully:     map[string]bool{},
  
  		queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "autoregister"),
  	}
  	c.syncHandler = c.checkAPIService
  
  	apiServiceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
  		AddFunc: func(obj interface{}) {
  			cast := obj.(*apiregistration.APIService)
  			c.queue.Add(cast.Name)
  		},
  		UpdateFunc: func(_, obj interface{}) {
  			cast := obj.(*apiregistration.APIService)
  			c.queue.Add(cast.Name)
  		},
  		DeleteFunc: func(obj interface{}) {
  			cast, ok := obj.(*apiregistration.APIService)
  			if !ok {
  				tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
  				if !ok {
  					klog.V(2).Infof("Couldn't get object from tombstone %#v", obj)
  					return
  				}
  				cast, ok = tombstone.Obj.(*apiregistration.APIService)
  				if !ok {
  					klog.V(2).Infof("Tombstone contained unexpected object: %#v", obj)
  					return
  				}
  			}
  			c.queue.Add(cast.Name)
  		},
  	})
  
  	return c
  }
docs: // NewAutoRegisterController creates a new autoRegisterController.