diff --git a/library/common-test/Chart.yaml b/library/common-test/Chart.yaml index cfc7fd03094..1a4193aee95 100644 --- a/library/common-test/Chart.yaml +++ b/library/common-test/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 kubeVersion: ">=1.16.0-0" name: common-test -version: 2.1.3 +version: 2.1.4 # upstream_version: appVersion: none description: Helper chart to test different use cases of the common library diff --git a/library/common-test/values.yaml b/library/common-test/values.yaml index e7b92a8986f..bf0fcc3f4f7 100644 --- a/library/common-test/values.yaml +++ b/library/common-test/values.yaml @@ -55,7 +55,6 @@ additionalIngress: enabled: true # these values and names are set specifically with the unittests in mind. -fixMountPermissions: false deviceMounts: test1: enabled: true diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index c4413145250..fb61a4538b2 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 kubeVersion: ">=1.16.0-0" name: common -version: 3.0.4 +version: 3.5.0 # upstream_version: appVersion: none description: Function library for TrueCharts diff --git a/library/common/templates/lib/controller/_volumeMounts.tpl b/library/common/templates/lib/controller/_volumeMounts.tpl index 196c0f27dfd..e69903e0286 100644 --- a/library/common/templates/lib/controller/_volumeMounts.tpl +++ b/library/common/templates/lib/controller/_volumeMounts.tpl @@ -37,6 +37,9 @@ Volumes included by the controller. {{ if $csm.subPath }} subPath: {{ $csm.subPath }} {{ end }} + {{ if $csm.readOnly }} + readOnly: {{ $csm.readOnly }} + {{ end }} {{- end -}} {{ end }} diff --git a/library/common/templates/lib/storage/_mountPermissions.tpl b/library/common/templates/lib/storage/_mountPermissions.tpl index 8ff1f1b691a..8799e91fa57 100644 --- a/library/common/templates/lib/storage/_mountPermissions.tpl +++ b/library/common/templates/lib/storage/_mountPermissions.tpl @@ -40,11 +40,40 @@ spec: #securityContext: # volumeMounts: - {{- include "common.controller.volumeMounts" . | indent 12 }} - {{- with (include "common.controller.volumes" . | trim) }} + {{ range $name, $csm := .Values.customStorage }} + {{- if $csm.enabled -}} + {{- if $csm.setPermissions -}} + {{ if $csm.name }} + {{ $name = $csm.name }} + {{ end }} + - name: customstorage-{{ $name }} + mountPath: {{ $csm.mountPath }} + {{ if $csm.subPath }} + subPath: {{ $csm.subPath }} + {{ end }} + {{ if $csm.readOnly }} + readOnly: {{ $csm.readOnly }} + {{ end }} + {{- end -}} + {{- end -}} + {{ end }} volumes: - {{- . | nindent 8 }} - {{- end }} + {{- range $name, $cs := .Values.customStorage -}} + {{ if $cs.enabled }} + {{ if $cs.setPermissions }} + {{ if $cs.name }} + {{ $name = $cs.name }} + {{ end }} + - name: customstorage-{{ $name }} + {{ if $cs.emptyDir }} + emptyDir: {} + {{- else -}} + hostPath: + path: {{ required "hostPath not set" $cs.hostPath }} + {{ end }} + {{ end }} + {{ end }} + {{- end -}} {{- end }} diff --git a/library/common/values.yaml b/library/common/values.yaml index 35ea991634f..9b15e1274ed 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -310,4 +310,5 @@ fixMountPermissions: true # mountPath: "/data" # subPath: some-subpath # hostPath: "" +# readOnly: false # setPermissions: true