Files
chart/community/unifi-protect-backup/1.0.0/templates/_validation.tpl
2023-09-06 12:38:21 +00:00

11 lines
387 B
Smarty

{{- define "upb.validation" -}}
{{- $validTypes := (list "motion" "person" "vehicle" "ring") -}}
{{- range $type := .Values.upbConfig.detectionTypes -}}
{{- if not (mustHas $type $validTypes) -}}
{{- fail (printf "Unifi Protect Backup - Expected Detection type to be one of [%s], but got [%s]" (join ", " $validTypes) $type) -}}
{{- end -}}
{{- end -}}
{{- end -}}