func (c *ControllerV1) createWebhook(secret *corev1.Secret) error {
	webhook := &admiv1.MutatingWebhookConfiguration{
		ObjectMeta: metav1.ObjectMeta{
			Name: c.config.getWebhookName(),
		},
		Webhooks: c.newWebhooks(secret),
	}

	_, err := c.clientSet.AdmissionregistrationV1().MutatingWebhookConfigurations().Create(context.TODO(), webhook, metav1.CreateOptions{})
	if errors.IsAlreadyExists(err) {
		log.Infof("Webhook %s already exists", webhook.GetName())
		return nil
	}

	return err
}
// createWebhook creates a new MutatingWebhookConfiguration object.
createWebhook creates a new MutatingWebhookConfiguration object.
// createWebhook creates a new MutatingWebhookConfiguration object .
func (c *ControllerV1) createWebhook(secret *corev1.Secret) error {
	webhook := &admiv1.MutatingWebhookConfiguration{
		ObjectMeta: metav1.ObjectMeta{
			Name: c.config.getWebhookName(),
		},
		Webhooks: c.newWebhooks(secret),
	}
	_, err := c.clientSet.AdmissionregistrationV1().MutatingWebhookConfigurations().Create(context.TODO(), webhook, metav1.CreateOptions{})
	if errors.IsAlreadyExists(err) {
		log.Infof("Webhook %s already exists", webhook.GetName())
		return nil
	}
	return err
}
func ( c * ControllerV1 ) createWebhook ( secret * corev1 . Secret ) error { webhook := & admiv1 . MutatingWebhookConfiguration { ObjectMeta : metav1 . ObjectMeta { Name : c . config . getWebhookName ( ) , } , Webhooks : c . newWebhooks ( secret ) , } _ , err := c . clientSet . AdmissionregistrationV1 ( ) . MutatingWebhookConfigurations ( ) . Create ( context . TODO ( ) , webhook , metav1 . CreateOptions { } ) if errors . IsAlreadyExists ( err ) { log . Infof ( " " , webhook . GetName ( ) ) return nil } return err }
createWebhook creates a new MutatingWebhookConfiguration object.
createWebhook creates a new MutatingWebhookConfiguration object .