Skip to content

Commit c86a088

Browse files
committed
Fixed the configFiles rendering
1 parent ee62199 commit c86a088

6 files changed

Lines changed: 18 additions & 15 deletions

File tree

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{- $files := .Files -}}
21
{{ range .Values.configFiles }}
32
---
43
apiVersion: v1
@@ -7,6 +6,6 @@ metadata:
76
name: {{ include "amavis.fullname" $ }}-{{ .name }}
87
namespace: {{ $.Release.Namespace }}
98
data:
10-
{{ base .path }}: |-
11-
{{- tpl ($files.Get .path) $ | nindent 4 -}}
9+
{{ base .mountPath }}: |-
10+
{{- .content | nindent 4 -}}
1211
{{- end -}}

examples/helm-charts/amavis/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spec:
5555
{{- range .Values.configFiles }}
5656
- name: {{ .name }}
5757
mountPath: {{ .mountPath }}
58-
subPath: {{ base .path }}
58+
subPath: {{ base .mountPath }}
5959
{{- end }}
6060
{{- if .Values.additionalContainerSpec -}}
6161
{{- toYaml .Values.additionalContainerSpec | nindent 8 }}

examples/helm-charts/amavis/values.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ virusAdminEmail: ""
5151
# $configfiles - list of config file definitions
5252
# $configfiles[].name - unique name for config definition
5353
# $configfiles[].mountPath - path of file in pod to mount at
54-
# $configfiles[].path - the config file (must be accessible within HELM chart)
55-
configFiles: {}
54+
# $configfiles[].content - the config file content
55+
# ATTENTION: You better pass the content with command line arguments to HELM:
56+
# --set-file "configFiles[0].content=/path/to/file" (quotes required)
57+
configFiles: []
5658
#- name: example1
5759
# mountPath: /etc/spamassassin/x10-example.cf
58-
# path: example1.cf
60+
# content: "content of file"
5961
#- name: example2
6062
# mountPath: /etc/spamassassin/x20-example.cf
61-
# path: example2.cf
63+
# content: "content of file"
6264

6365
# $additionalTemplateSpec - Add more deployment template specification at this value
6466
# $additionalPodSpec - Add more pod specification at this value

examples/helm-charts/postfix/templates/configFiles.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ metadata:
77
name: {{ include "postfix.fullname" $ }}-{{ .name }}
88
namespace: {{ $.Release.Namespace }}
99
data:
10-
{{ base .path }}: |-
11-
{{- tpl ($files.Get .path) $ | nindent 4 -}}
10+
{{ base .mountPath }}: |-
11+
{{- .content | nindent 4 -}}
1212
{{- end -}}

examples/helm-charts/postfix/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ spec:
9797
{{- range .Values.configFiles }}
9898
- name: {{ .name }}
9999
mountPath: {{ .mountPath }}
100-
subPath: {{ base .path }}
100+
subPath: {{ base .mountPath }}
101101
{{- end }}
102102
{{- if .Values.additionalContainerSpec -}}
103103
{{- toYaml .Values.additionalContainerSpec | nindent 8 }}

examples/helm-charts/postfix/values.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ tlsKey: ""
9696
# $configfiles - list of config file definitions
9797
# $configfiles[].name - unique name for config definition
9898
# $configfiles[].mountPath - path of file in pod to mount at
99-
# $configfiles[].path - the config file (must be accessible within HELM chart)
100-
configFiles: {}
99+
# $configfiles[].content - the config file content
100+
# ATTENTION: You better pass the content with command line arguments to HELM:
101+
# --set-file "configFiles[0].content=/path/to/file" (quotes required)
102+
configFiles: []
101103
#- name: example1
102104
# mountPath: /etc/postfix/x10-example.cf
103-
# path: example1.cf
105+
# content: "content of file"
104106
#- name: example2
105107
# mountPath: /etc/postfix/x20-example.cf
106-
# path: example2.cf
108+
# content: "content of file"
107109

108110
# $additionalTemplateSpec - Add more deployment template specification at this value
109111
# $additionalPodSpec - Add more pod specification at this value

0 commit comments

Comments
 (0)