From c6ce41be987d41caf7171c690c3e83378dcd5639 Mon Sep 17 00:00:00 2001 From: cbzzz <69888673+cbzzz@users.noreply.github.com> Date: Thu, 23 May 2024 18:13:34 -0400 Subject: [PATCH] Revert "chore: add webhook toggle" (#334) This reverts commit 4ab0d88f2478313438adf1f732d0eaa8abdb7d9c. --- Makefile | 2 -- Tiltfile | 3 --- config/default/.gitignore | 1 - config/default/kustomization.yaml | 20 +------------------- config/default/manager-configmap.yaml | 7 ------- config/default/manager_webhook_patch.yaml | 6 ------ 6 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 config/default/manager-configmap.yaml diff --git a/Makefile b/Makefile index f44e5f047..b3109b500 100644 --- a/Makefile +++ b/Makefile @@ -152,7 +152,6 @@ e2etest: generate local-release local-deploy chainsaw local-deploy: kind ctlptl tilt kustomize clusterctl @echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode - @echo -n "ENABLE_WEBHOOKS=$(ENABLE_WEBHOOKS)" > config/default/.env.manager $(CTLPTL) apply -f .tilt/ctlptl-config.yaml $(TILT) ci -f Tiltfile @@ -205,7 +204,6 @@ endif .PHONY: tilt-cluster tilt-cluster: ctlptl tilt kind clusterctl @echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode - @echo -n "ENABLE_WEBHOOKS=$(ENABLE_WEBHOOKS)" > config/default/.env.manager $(CTLPTL) apply -f .tilt/ctlptl-config.yaml $(TILT) up --stream diff --git a/Tiltfile b/Tiltfile index 7898164d4..37cb500a6 100644 --- a/Tiltfile +++ b/Tiltfile @@ -98,8 +98,6 @@ for resource in manager_yaml: resource["stringData"]["apiToken"] = os.getenv("LINODE_TOKEN") if resource["kind"] == "CustomResourceDefinition" and resource["spec"]["group"] == "infrastructure.cluster.x-k8s.io": resource["metadata"]["labels"]["clusterctl.cluster.x-k8s.io"] = "" - if resource["metadata"]["name"] == "capl-manager-config": - resource["data"]["ENABLE_WEBHOOKS"] = os.getenv("ENABLE_WEBHOOKS", "true") k8s_yaml(encode_yaml_stream(manager_yaml)) if os.getenv("SKIP_DOCKER_BUILD", "false") != "true": @@ -130,7 +128,6 @@ k8s_resource( "capl-manager-rolebinding:clusterrolebinding", "capl-proxy-rolebinding:clusterrolebinding", "capl-manager-credentials:secret", - "capl-manager-config:configmap", "capl-serving-cert:certificate", "capl-selfsigned-issuer:issuer", "capl-validating-webhook-configuration:validatingwebhookconfiguration", diff --git a/config/default/.gitignore b/config/default/.gitignore index 9ee9538a6..49686d40f 100644 --- a/config/default/.gitignore +++ b/config/default/.gitignore @@ -1,2 +1 @@ .env.linode -.env.manager diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 3cbb5398c..4117f8227 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -13,7 +13,6 @@ resources: - ../rbac - ../manager - linode-token-secret.yaml -- manager-configmap.yaml # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml - ../webhook @@ -36,26 +35,9 @@ patches: # 'CERTMANAGER' needs to be enabled to use ca injection - path: webhookcainjection_patch.yaml -replacements: - -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml - - source: - kind: ConfigMap - version: v1 - name: manager-config # this name should match the one in manager-configmap.yaml - fieldPath: .metadata.name - targets: - - select: - kind: Deployment - group: apps - version: v1 - name: controller-manager - fieldPaths: - - .spec.template.spec.containers.[name=manager].env.[name=ENABLE_WEBHOOKS].valueFrom.configMapKeyRef.name - # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. # Uncomment the following replacements to add the cert-manager CA injection annotations +replacements: - source: # Add cert-manager annotation to ValidatingWebhookConfiguration, MutatingWebhookConfiguration and CRDs kind: Certificate group: cert-manager.io diff --git a/config/default/manager-configmap.yaml b/config/default/manager-configmap.yaml deleted file mode 100644 index f5b12264d..000000000 --- a/config/default/manager-configmap.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: manager-config -data: - ENABLE_WEBHOOKS: ${ENABLE_WEBHOOKS} diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml index f0a67f1c7..738de350b 100644 --- a/config/default/manager_webhook_patch.yaml +++ b/config/default/manager_webhook_patch.yaml @@ -8,12 +8,6 @@ spec: spec: containers: - name: manager - env: - - name: ENABLE_WEBHOOKS - valueFrom: - configMapKeyRef: - name: manager-config - key: ENABLE_WEBHOOKS ports: - containerPort: 9443 name: webhook-server