mirror of
https://github.com/truenas/charts.git
synced 2026-04-08 21:28:46 +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
23 lines
948 B
Smarty
23 lines
948 B
Smarty
{{/* Persistence Validation */}}
|
|
{{/* Call this template:
|
|
{{ include "ix.v1.common.lib.persistence.validation" (dict "objectData" $objectData) -}}
|
|
objectData:
|
|
rootCtx: The root context of the chart.
|
|
objectData: The persistence object.
|
|
*/}}
|
|
|
|
{{- define "ix.v1.common.lib.persistence.validation" -}}
|
|
{{- $rootCtx := .rootCtx -}}
|
|
{{- $objectData := .objectData -}}
|
|
|
|
{{- $types := (list "smb-pv-pvc" "nfs-pv-pvc" "ix-zfs-pvc" "pvc" "emptyDir" "hostPath" "ixVolume" "secret" "configmap" "device") -}}
|
|
{{- if not (mustHas $objectData.type $types) -}}
|
|
{{- fail (printf "Persistence - Expected <type> to be one of [%s], but got [%s]" (join ", " $types) $objectData.type) -}}
|
|
{{- end -}}
|
|
|
|
{{- if and $objectData.targetSelector (not (kindIs "map" $objectData.targetSelector)) -}}
|
|
{{- fail (printf "Persistence - Expected <targetSelector> to be [dict], but got [%s]" (kindOf $objectData.targetSelector)) -}}
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|