create a way of not mounting volumes (#650)

* create a way of not mounting volumes

* fix mistake

* also noMount for statefull sets
This commit is contained in:
Kjeld Schouten-Lebbing
2021-07-03 11:16:55 +02:00
committed by GitHub
parent a6b432fd41
commit dd3b299e2b
5 changed files with 25 additions and 2 deletions
+1 -1
View File
@@ -18,4 +18,4 @@ maintainers:
name: common
sources:
type: library
version: 6.4.6
version: 6.5.0
@@ -1,6 +1,7 @@
{{/* Volumes included by the controller */}}
{{- define "common.controller.volumeMounts" -}}
{{- range $index, $item := .Values.persistence }}
{{- if not $item.noMount }}
{{- $mountPath := (printf "/%v" $index) -}}
{{- if eq "hostPath" (default "pvc" $item.type) -}}
{{- $mountPath = $item.hostPath -}}
@@ -19,15 +20,19 @@
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if eq .Values.controller.type "statefulset" }}
{{- range $index, $vct := .Values.volumeClaimTemplates }}
{{- if not $vct.noMount }}
- mountPath: {{ $vct.mountPath }}
name: {{ $vct.name }}
{{- if $vct.subPath }}
subPath: {{ $vct.subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}