allow setting readOnly on customStorage and limit permissionsmounts (#357)
* alles setting readOnly on customStorage * update common version and example * fix a typo * Limit volume mounting for permission fix to relevant volumes.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
name: common-test
|
name: common-test
|
||||||
version: 2.1.3
|
version: 2.1.4
|
||||||
# upstream_version:
|
# upstream_version:
|
||||||
appVersion: none
|
appVersion: none
|
||||||
description: Helper chart to test different use cases of the common library
|
description: Helper chart to test different use cases of the common library
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ additionalIngress:
|
|||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# these values and names are set specifically with the unittests in mind.
|
# these values and names are set specifically with the unittests in mind.
|
||||||
fixMountPermissions: false
|
|
||||||
deviceMounts:
|
deviceMounts:
|
||||||
test1:
|
test1:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
kubeVersion: ">=1.16.0-0"
|
kubeVersion: ">=1.16.0-0"
|
||||||
name: common
|
name: common
|
||||||
version: 3.0.4
|
version: 3.5.0
|
||||||
# upstream_version:
|
# upstream_version:
|
||||||
appVersion: none
|
appVersion: none
|
||||||
description: Function library for TrueCharts
|
description: Function library for TrueCharts
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ Volumes included by the controller.
|
|||||||
{{ if $csm.subPath }}
|
{{ if $csm.subPath }}
|
||||||
subPath: {{ $csm.subPath }}
|
subPath: {{ $csm.subPath }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if $csm.readOnly }}
|
||||||
|
readOnly: {{ $csm.readOnly }}
|
||||||
|
{{ end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|||||||
@@ -40,11 +40,40 @@ spec:
|
|||||||
#securityContext:
|
#securityContext:
|
||||||
#
|
#
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
{{- include "common.controller.volumeMounts" . | indent 12 }}
|
{{ range $name, $csm := .Values.customStorage }}
|
||||||
{{- with (include "common.controller.volumes" . | trim) }}
|
{{- 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:
|
volumes:
|
||||||
{{- . | nindent 8 }}
|
{{- range $name, $cs := .Values.customStorage -}}
|
||||||
{{- end }}
|
{{ 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 }}
|
{{- end }}
|
||||||
|
|||||||
@@ -310,4 +310,5 @@ fixMountPermissions: true
|
|||||||
# mountPath: "/data"
|
# mountPath: "/data"
|
||||||
# subPath: some-subpath
|
# subPath: some-subpath
|
||||||
# hostPath: ""
|
# hostPath: ""
|
||||||
|
# readOnly: false
|
||||||
# setPermissions: true
|
# setPermissions: true
|
||||||
|
|||||||
Reference in New Issue
Block a user