diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 6fdb777..d08e34e 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -14,7 +14,7 @@ patchesStrategicMerge: # patches here are for enabling the conversion webhook for each CRD #- patches/webhook_in_tasks.yaml #- patches/webhook_in_functions.yaml -- patches/webhook_in_backupconfigurations.yaml +#- patches/webhook_in_backupconfigurations.yaml #- patches/webhook_in_backupsessions.yaml #- patches/webhook_in_repoes.yaml #- patches/webhook_in_restoresessions.yaml diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index f8cc21d..4a0397f 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -18,9 +18,9 @@ bases: - ../manager # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -- ../webhook +#- ../webhook # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -- ../certmanager +#- ../certmanager # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. #- ../prometheus @@ -32,39 +32,39 @@ patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -- manager_webhook_patch.yaml +#- manager_webhook_patch.yaml # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. # Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. # 'CERTMANAGER' needs to be enabled to use ca injection -- webhookcainjection_patch.yaml +#- webhookcainjection_patch.yaml # the following config is for teaching kustomize how to do var substitution vars: # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR - objref: - kind: Certificate - group: cert-manager.io - version: v1alpha2 - name: serving-cert # this name should match the one in certificate.yaml - fieldref: - fieldpath: metadata.namespace -- name: CERTIFICATE_NAME - objref: - kind: Certificate - group: cert-manager.io - version: v1alpha2 - name: serving-cert # this name should match the one in certificate.yaml -- name: SERVICE_NAMESPACE # namespace of the service - objref: - kind: Service - version: v1 - name: webhook-service - fieldref: - fieldpath: metadata.namespace -- name: SERVICE_NAME - objref: - kind: Service - version: v1 - name: webhook-service +#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR +# objref: +# kind: Certificate +# group: cert-manager.io +# version: v1alpha2 +# name: serving-cert # this name should match the one in certificate.yaml +# fieldref: +# fieldpath: metadata.namespace +#- name: CERTIFICATE_NAME +# objref: +# kind: Certificate +# group: cert-manager.io +# version: v1alpha2 +# name: serving-cert # this name should match the one in certificate.yaml +#- name: SERVICE_NAMESPACE # namespace of the service +# objref: +# kind: Service +# version: v1 +# name: webhook-service +# fieldref: +# fieldpath: metadata.namespace +#- name: SERVICE_NAME +# objref: +# kind: Service +# version: v1 +# name: webhook-service diff --git a/main.go b/main.go index d7cb1af..88c58f6 100644 --- a/main.go +++ b/main.go @@ -84,16 +84,6 @@ func main() { setupLog.Error(err, "unable to create controller", "controller", "BackupSession") os.Exit(1) } - if os.Getenv("ENABLE_WEBHOOKS") != "false" { - if err = (&formolv1alpha1.BackupSession{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "BackupSession") - os.Exit(1) - } - if err = (&formolv1alpha1.BackupConfiguration{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "BackupConfiguration") - os.Exit(1) - } - } if err = (&controllers.RestoreSessionReconciler{ Client: mgr.GetClient(), Log: ctrl.Log.WithName("controllers").WithName("RestoreSession"), @@ -102,10 +92,20 @@ func main() { setupLog.Error(err, "unable to create controller", "controller", "RestoreSession") os.Exit(1) } - if err = (&formoldesmojimfrv1alpha1.Function{}).SetupWebhookWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create webhook", "webhook", "Function") - os.Exit(1) - } + // if os.Getenv("ENABLE_WEBHOOKS") != "false" { + // if err = (&formolv1alpha1.BackupSession{}).SetupWebhookWithManager(mgr); err != nil { + // setupLog.Error(err, "unable to create webhook", "webhook", "BackupSession") + // os.Exit(1) + // } + // if err = (&formolv1alpha1.BackupConfiguration{}).SetupWebhookWithManager(mgr); err != nil { + // setupLog.Error(err, "unable to create webhook", "webhook", "BackupConfiguration") + // os.Exit(1) + // } + // if err = (&formoldesmojimfrv1alpha1.Function{}).SetupWebhookWithManager(mgr); err != nil { + // setupLog.Error(err, "unable to create webhook", "webhook", "Function") + // os.Exit(1) + // } + // } // +kubebuilder:scaffold:builder setupLog.Info("starting manager")