diff --git a/templates/deployment.yaml b/templates/deployment.yaml index c97758d..5ba32e9 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -102,10 +102,8 @@ spec: mountPath: "/benthos.yaml" subPath: "benthos.yaml" readOnly: true - {{- range .Values.extraVolumeMounts }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - readOnly: {{ .readOnly }} + {{- if .Values.extraVolumeMounts }} + {{- toYaml .Values.extraVolumeMounts | nindent 12 }} {{- end }} {{- if and .Values.streams.enabled .Values.streams.streamsConfigMap }} - name: streams diff --git a/tests/deployment_test.yaml b/tests/deployment_test.yaml index 3f4071c..a69aa84 100644 --- a/tests/deployment_test.yaml +++ b/tests/deployment_test.yaml @@ -204,3 +204,50 @@ tests: - configMap: name: my-config-map name: streams + + - it: should allow custom volume mounts + set: + deployment: + rolloutConfigMap: false + streams: + enabled: true + api: + enable: false + streamsConfigMap: "my-config-map" + extraVolumeMounts: + - mountPath: /testing + name: test + readOnly: true + subPath: testPath + asserts: + - equal: + path: spec.template.spec.containers[0].args + value: + - -c + - /benthos.yaml + - streams + - --no-api + - /streams/*.yaml + - equal: + path: spec.template.spec.containers[0].volumeMounts + value: + - mountPath: /benthos.yaml + name: config + readOnly: true + subPath: benthos.yaml + - mountPath: /testing + name: test + readOnly: true + subPath: testPath + - mountPath: /streams + name: streams + readOnly: true + - equal: + path: spec.template.spec.volumes + value: + - configMap: + name: RELEASE-NAME-benthos-config + name: config + - configMap: + name: my-config-map + name: streams \ No newline at end of file