update
diff --git a/charts/cert-manager/templates/webhook-config.yaml b/charts/cert-manager/templates/webhook-config.yaml
index f3f72f0..cd8b67f 100644
--- a/charts/cert-manager/templates/webhook-config.yaml
+++ b/charts/cert-manager/templates/webhook-config.yaml
@@ -1,12 +1,7 @@
{{- if .Values.webhook.config -}}
- {{- if not .Values.webhook.config.apiVersion -}}
- {{- fail "webhook.config.apiVersion must be set" -}}
- {{- end -}}
-
- {{- if not .Values.webhook.config.kind -}}
- {{- fail "webhook.config.kind must be set" -}}
- {{- end -}}
-{{- end -}}
+{{- $config := .Values.webhook.config -}}
+{{- $_ := set $config "apiVersion" (default "webhook.config.cert-manager.io/v1alpha1" $config.apiVersion) -}}
+{{- $_ := set $config "kind" (default "WebhookConfiguration" $config.kind) -}}
apiVersion: v1
kind: ConfigMap
metadata:
@@ -19,7 +14,6 @@
app.kubernetes.io/component: "webhook"
{{- include "labels" . | nindent 4 }}
data:
- {{- if .Values.webhook.config }}
config.yaml: |
- {{ .Values.webhook.config | toYaml | nindent 4 }}
- {{- end }}
+ {{- $config | toYaml | nindent 4 }}
+{{- end -}}
\ No newline at end of file