mirror of
https://github.com/truenas/charts.git
synced 2026-04-05 11:48:55 +08:00
* Empty-Commit * temp commit * make sure that we use the pv * typo * add validation * typo * cleanup validation and add secret for smb * revert * add some tets * add more tests * add more tests * more tests * rename to share * rename * moar tests * clean * add some docs * fix name uniqueness and tests * make mountOptions validation a bit better * update docs
33 lines
1.1 KiB
Smarty
33 lines
1.1 KiB
Smarty
{{/* PVC - Access Modes */}}
|
|
{{/* Call this template:
|
|
{{ include "ix.v1.common.lib.pvc.accessModes" (dict "rootCtx" $rootCtx "objectData" $objectData) -}}
|
|
rootCtx: The root context of the chart.
|
|
objectData: The object data of the pvc
|
|
*/}}
|
|
|
|
{{- define "ix.v1.common.lib.pvc.accessModes" -}}
|
|
{{- $rootCtx := .rootCtx -}}
|
|
{{- $objectData := .objectData -}}
|
|
{{- $caller := .caller -}}
|
|
|
|
{{- $accessModes := $objectData.accessModes -}}
|
|
|
|
{{- if kindIs "string" $accessModes -}}
|
|
{{- $accessModes = (list $accessModes) -}}
|
|
{{- end -}}
|
|
|
|
{{- if not $accessModes -}}
|
|
{{- $accessModes = $rootCtx.Values.fallbackDefaults.accessModes -}}
|
|
{{- end -}}
|
|
|
|
{{- $validAccessModes := (list "ReadWriteOnce" "ReadOnlyMany" "ReadWriteMany" "ReadWriteOncePod") -}}
|
|
|
|
{{- range $accessModes -}}
|
|
{{- $mode := tpl . $rootCtx -}}
|
|
{{- if not (mustHas $mode $validAccessModes) -}}
|
|
{{- fail (printf "%s - Expected <accessModes> entry to be one of [%s], but got [%s]" $caller (join ", " $validAccessModes) $mode) -}}
|
|
{{- end }}
|
|
- {{ $mode }}
|
|
{{- end -}}
|
|
{{- end -}}
|