Disabled webhooks and certmanager for now

This commit is contained in:
jandre 2021-04-27 21:44:54 +02:00
parent 191207e901
commit 86fb58a2ef
3 changed files with 45 additions and 45 deletions

View File

@ -14,7 +14,7 @@ patchesStrategicMerge:
# patches here are for enabling the conversion webhook for each CRD # patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_tasks.yaml #- patches/webhook_in_tasks.yaml
#- patches/webhook_in_functions.yaml #- patches/webhook_in_functions.yaml
- patches/webhook_in_backupconfigurations.yaml #- patches/webhook_in_backupconfigurations.yaml
#- patches/webhook_in_backupsessions.yaml #- patches/webhook_in_backupsessions.yaml
#- patches/webhook_in_repoes.yaml #- patches/webhook_in_repoes.yaml
#- patches/webhook_in_restoresessions.yaml #- patches/webhook_in_restoresessions.yaml

View File

@ -18,9 +18,9 @@ bases:
- ../manager - ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml # crd/kustomization.yaml
- ../webhook #- ../webhook
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. # [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] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus #- ../prometheus
@ -32,39 +32,39 @@ patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml # crd/kustomization.yaml
- manager_webhook_patch.yaml #- manager_webhook_patch.yaml
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. # [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. # 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 # '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 # the following config is for teaching kustomize how to do var substitution
vars: vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR #- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
objref: # objref:
kind: Certificate # kind: Certificate
group: cert-manager.io # group: cert-manager.io
version: v1alpha2 # version: v1alpha2
name: serving-cert # this name should match the one in certificate.yaml # name: serving-cert # this name should match the one in certificate.yaml
fieldref: # fieldref:
fieldpath: metadata.namespace # fieldpath: metadata.namespace
- name: CERTIFICATE_NAME #- name: CERTIFICATE_NAME
objref: # objref:
kind: Certificate # kind: Certificate
group: cert-manager.io # group: cert-manager.io
version: v1alpha2 # version: v1alpha2
name: serving-cert # this name should match the one in certificate.yaml # name: serving-cert # this name should match the one in certificate.yaml
- name: SERVICE_NAMESPACE # namespace of the service #- name: SERVICE_NAMESPACE # namespace of the service
objref: # objref:
kind: Service # kind: Service
version: v1 # version: v1
name: webhook-service # name: webhook-service
fieldref: # fieldref:
fieldpath: metadata.namespace # fieldpath: metadata.namespace
- name: SERVICE_NAME #- name: SERVICE_NAME
objref: # objref:
kind: Service # kind: Service
version: v1 # version: v1
name: webhook-service # name: webhook-service

28
main.go
View File

@ -84,16 +84,6 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "BackupSession") setupLog.Error(err, "unable to create controller", "controller", "BackupSession")
os.Exit(1) 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{ if err = (&controllers.RestoreSessionReconciler{
Client: mgr.GetClient(), Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("RestoreSession"), Log: ctrl.Log.WithName("controllers").WithName("RestoreSession"),
@ -102,10 +92,20 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "RestoreSession") setupLog.Error(err, "unable to create controller", "controller", "RestoreSession")
os.Exit(1) os.Exit(1)
} }
if err = (&formoldesmojimfrv1alpha1.Function{}).SetupWebhookWithManager(mgr); err != nil { // if os.Getenv("ENABLE_WEBHOOKS") != "false" {
setupLog.Error(err, "unable to create webhook", "webhook", "Function") // if err = (&formolv1alpha1.BackupSession{}).SetupWebhookWithManager(mgr); err != nil {
os.Exit(1) // 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 // +kubebuilder:scaffold:builder
setupLog.Info("starting manager") setupLog.Info("starting manager")