// NewController creates a new JenkinsConfigController
NewController creates a new JenkinsConfigController
// NewController creates a new JenkinsConfigController
func NewController(
	options *ControllerOptions,
	devopsOptions *jenkins.Options,
) *Controller {
	controller := &Controller{
		configmapLister: options.ConfigMapInformer.Lister(),
		namespaceLister: options.NamespaceInformer.Lister(),
		configmapSynced: options.ConfigMapInformer.Informer().HasSynced,
		limitRangeClient:    options.LimitRangeClient,
		resourceQuotaClient: options.ResourceQuotaClient,
		configMapClient:     options.ConfigMapClient,
		configOperator: options.ConfigOperator,
		queue:            workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), jenkinsConfigName),
		workerLoopPeriod: time.Second,
		ReloadCasCDelay:  options.ReloadCasCDelay,
		devopsOptions: devopsOptions,
	}
	options.ConfigMapInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc: controller.enqueue,
		UpdateFunc: func(oldObj, newObj interface{}) {
			oldConfigMap := oldObj.(*v1.ConfigMap)
			newConfigMap := newObj.(*v1.ConfigMap)
			if oldConfigMap.ResourceVersion == newConfigMap.ResourceVersion {
				return
			}
			controller.enqueue(newObj)
		},
		DeleteFunc: controller.enqueue,
	})
	return controller
}
func NewController ( options * ControllerOptions , devopsOptions * jenkins . Options , ) * Controller { controller := & Controller { configmapLister : options . ConfigMapInformer . Lister ( ) , namespaceLister : options . NamespaceInformer . Lister ( ) , configmapSynced : options . ConfigMapInformer . Informer ( ) . HasSynced , limitRangeClient : options . LimitRangeClient , resourceQuotaClient : options . ResourceQuotaClient , configMapClient : options . ConfigMapClient , configOperator : options . ConfigOperator , queue : workqueue . NewNamedRateLimitingQueue ( workqueue . DefaultControllerRateLimiter ( ) , jenkinsConfigName ) , workerLoopPeriod : time . Second , ReloadCasCDelay : options . ReloadCasCDelay , devopsOptions : devopsOptions , } options . ConfigMapInformer . Informer ( ) . AddEventHandler ( cache . ResourceEventHandlerFuncs { AddFunc : controller . enqueue , UpdateFunc : func ( oldObj , newObj interface { } ) { oldConfigMap := oldObj . ( * v1 . ConfigMap ) newConfigMap := newObj . ( * v1 . ConfigMap ) if oldConfigMap . ResourceVersion == newConfigMap . ResourceVersion { return } controller . enqueue ( newObj ) } , DeleteFunc : controller . enqueue , } ) return controller }
NewController creates a new JenkinsConfigController
NewController creates a new JenkinsConfigController