Skip to content

Commit

Permalink
Revert "chore: add webhook toggle" (#334)
Browse files Browse the repository at this point in the history
This reverts commit 4ab0d88.
  • Loading branch information
cbzzz authored May 23, 2024
1 parent 8bdba73 commit c6ce41b
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 38 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion config/default/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.env.linode
.env.manager
20 changes: 1 addition & 19 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions config/default/manager-configmap.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions config/default/manager_webhook_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6ce41b

Please sign in to comment.