func NewControllerV1(client kubernetes.Interface, secretInformer coreinformers.SecretInformer, webhookInformer admissioninformers.MutatingWebhookConfigurationInformer, isLeaderFunc func() bool, config Config) *ControllerV1 {
	controller := &ControllerV1{}
	controller.clientSet = client
	controller.config = config
	controller.secretsLister = secretInformer.Lister()
	controller.secretsSynced = secretInformer.Informer().HasSynced
	controller.webhooksLister = webhookInformer.Lister()
	controller.webhooksSynced = webhookInformer.Informer().HasSynced
	controller.queue = workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "webhooks")
	controller.isLeaderFunc = isLeaderFunc
	controller.generateTemplates()

	secretInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    controller.handleSecret,
		UpdateFunc: controller.handleSecretUpdate,
		DeleteFunc: controller.handleSecret,
	})

	webhookInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    controller.handleWebhook,
		UpdateFunc: controller.handleWebhookUpdate,
		DeleteFunc: controller.handleWebhook,
	})

	return controller
}
// NewControllerV1 returns a new Webhook Controller using admissionregistration/v1.
NewControllerV1 returns a new Webhook Controller using admissionregistration/v1.
// NewControllerV1 returns a new Webhook Controller using admissionregistration / v1 .
func NewControllerV1(client kubernetes.Interface, secretInformer coreinformers.SecretInformer, webhookInformer admissioninformers.MutatingWebhookConfigurationInformer, isLeaderFunc func() bool, config Config) *ControllerV1 {
	controller := &ControllerV1{}
	controller.clientSet = client
	controller.config = config
	controller.secretsLister = secretInformer.Lister()
	controller.secretsSynced = secretInformer.Informer().HasSynced
	controller.webhooksLister = webhookInformer.Lister()
	controller.webhooksSynced = webhookInformer.Informer().HasSynced
	controller.queue = workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "webhooks")
	controller.isLeaderFunc = isLeaderFunc
	controller.generateTemplates()
	secretInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    controller.handleSecret,
		UpdateFunc: controller.handleSecretUpdate,
		DeleteFunc: controller.handleSecret,
	})
	webhookInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    controller.handleWebhook,
		UpdateFunc: controller.handleWebhookUpdate,
		DeleteFunc: controller.handleWebhook,
	})
	return controller
}
func NewControllerV1 ( client kubernetes . Interface , secretInformer coreinformers . SecretInformer , webhookInformer admissioninformers . MutatingWebhookConfigurationInformer , isLeaderFunc func ( ) bool , config Config ) * ControllerV1 { controller := & ControllerV1 { } controller . clientSet = client controller . config = config controller . secretsLister = secretInformer . Lister ( ) controller . secretsSynced = secretInformer . Informer ( ) . HasSynced controller . webhooksLister = webhookInformer . Lister ( ) controller . webhooksSynced = webhookInformer . Informer ( ) . HasSynced controller . queue = workqueue . NewNamedRateLimitingQueue ( workqueue . DefaultControllerRateLimiter ( ) , " " ) controller . isLeaderFunc = isLeaderFunc controller . generateTemplates ( ) secretInformer . Informer ( ) . AddEventHandler ( cache . ResourceEventHandlerFuncs { AddFunc : controller . handleSecret , UpdateFunc : controller . handleSecretUpdate , DeleteFunc : controller . handleSecret , } ) webhookInformer . Informer ( ) . AddEventHandler ( cache . ResourceEventHandlerFuncs { AddFunc : controller . handleWebhook , UpdateFunc : controller . handleWebhookUpdate , DeleteFunc : controller . handleWebhook , } ) return controller }
NewControllerV1 returns a new Webhook Controller using admissionregistration/v1.
NewControllerV1 returns a new Webhook Controller using admissionregistration / v1 .