Skip to content

Commit

Permalink
BUGFIX: correctly mount config files for components
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
  • Loading branch information
inteon authored and cert-manager-bot committed May 28, 2024
1 parent d3e8db7 commit c392ea8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
20 changes: 18 additions & 2 deletions deploy/charts/cert-manager/templates/cainjector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ spec:
{{- if not (has (quote .Values.global.logLevel) (list "" (quote ""))) }}
- --v={{ .Values.global.logLevel }}
{{- end }}
{{- if .Values.cainjector.config }}
- --config=/var/cert-manager/config/config.yaml
{{- end }}
{{- with .Values.global.leaderElection }}
- --leader-election-namespace={{ .namespace }}
{{- if .leaseDuration }}
Expand Down Expand Up @@ -97,9 +100,15 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.cainjector.volumeMounts }}
{{- if or .Values.cainjector.config .Values.cainjector.volumeMounts }}
volumeMounts:
{{- if .Values.cainjector.config }}
- name: config
mountPath: /var/cert-manager/config
{{- end }}
{{- with .Values.cainjector.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.cainjector.nodeSelector }}
nodeSelector:
Expand All @@ -117,8 +126,15 @@ spec:
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.cainjector.volumes }}
{{- if or .Values.cainjector.volumes .Values.cainjector.config }}
volumes:
{{- if .Values.cainjector.config }}
- name: config
configMap:
name: {{ include "cainjector.fullname" . }}
{{- end }}
{{ with .Values.cainjector.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
8 changes: 4 additions & 4 deletions deploy/charts/cert-manager/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ spec:
{{- end }}
{{- if or .Values.volumes .Values.config}}
volumes:
{{- if .Values.config }}
{{- if .Values.config }}
- name: config
configMap:
name: {{ include "cert-manager.fullname" . }}
name: {{ include "cert-manager.fullname" . }}
{{- end }}
{{ with .Values.volumes }}
{{- toYaml . | nindent 8 }}
Expand Down Expand Up @@ -150,11 +150,11 @@ spec:
{{- end }}
{{- if or .Values.config .Values.volumeMounts }}
volumeMounts:
{{- if .Values.config}}
{{- if .Values.config }}
- name: config
mountPath: /var/cert-manager/config
{{- end }}
{{- with .Values.volumeMounts }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions deploy/charts/cert-manager/templates/webhook-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ spec:
- name: config
mountPath: /var/cert-manager/config
{{- end }}
{{- if .Values.webhook.volumeMounts }}
{{- toYaml .Values.webhook.volumeMounts | nindent 12 }}
{{- with .Values.webhook.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.webhook.nodeSelector }}
Expand All @@ -186,7 +186,7 @@ spec:
configMap:
name: {{ include "webhook.fullname" . }}
{{- end }}
{{- if .Values.webhook.volumes }}
{{- toYaml .Values.webhook.volumes | nindent 8 }}
{{- with .Values.webhook.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

0 comments on commit c392ea8

Please sign in to comment.