Skip to content

Commit

Permalink
feat: default ControllerConfiguration apiVersion and kind in helm
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Talbot <adam.talbot@venafi.com>
  • Loading branch information
ThatsMrTalbot committed Jun 25, 2024
1 parent 46100d4 commit 2d0d4bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions deploy/charts/cert-manager/templates/cainjector-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Values.cainjector.config -}}
{{- $_ := .Values.cainjector.config.apiVersion | required ".Values.cainjector.config.apiVersion must be set !" -}}
{{- $_ := .Values.cainjector.config.kind | required ".Values.cainjector.config.kind must be set !" -}}
{{- $config := .Values.webhook.config -}}
{{- $_ := set $config "apiVersion" (default "cainjector.config.cert-manager.io/v1alpha1" $config.apiVersion) -}}
{{- $_ := set $config "kind" (default "CAInjectorConfiguration" $config.kind) -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -14,5 +15,5 @@ metadata:
{{- include "labels" . | nindent 4 }}
data:
config.yaml: |
{{- .Values.cainjector.config | toYaml | nindent 4 }}
{{- $config | toYaml | nindent 4 }}
{{- end -}}
7 changes: 4 additions & 3 deletions deploy/charts/cert-manager/templates/controller-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Values.config -}}
{{- $_ := .Values.config.apiVersion | required ".Values.config.apiVersion must be set !" -}}
{{- $_ := .Values.config.kind | required ".Values.config.kind must be set !" -}}
{{- $config := .Values.config -}}
{{- $_ := set $config "apiVersion" (default "controller.config.cert-manager.io/v1alpha1" $config.apiVersion) -}}
{{- $_ := set $config "kind" (default "ControllerConfiguration" $config.kind) -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -14,5 +15,5 @@ metadata:
{{- include "labels" . | nindent 4 }}
data:
config.yaml: |
{{- .Values.config | toYaml | nindent 4 }}
{{- $config | toYaml | nindent 4 }}
{{- end -}}
7 changes: 4 additions & 3 deletions deploy/charts/cert-manager/templates/webhook-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Values.webhook.config -}}
{{- $_ := .Values.webhook.config.apiVersion | required ".Values.webhook.config.apiVersion must be set !" -}}
{{- $_ := .Values.webhook.config.kind | required ".Values.webhook.config.kind must be set !" -}}
{{- $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:
Expand All @@ -14,5 +15,5 @@ metadata:
{{- include "labels" . | nindent 4 }}
data:
config.yaml: |
{{- .Values.webhook.config | toYaml | nindent 4 }}
{{- $config | toYaml | nindent 4 }}
{{- end -}}

0 comments on commit 2d0d4bf

Please sign in to comment.