Files
charts/community/chia/1.0.7/templates/_validation.tpl
T
2023-05-04 11:22:55 +00:00

23 lines
695 B
Smarty

{{- define "chia.validation" -}}
{{- with $.Values.chiaConfig.service -}}
{{- $allowedModes := list "farmer-only" "harvester" "\"\"" -}}
{{- if not (mustHas . $allowedModes) -}}
{{- fail (printf "Expected <service> to be one of [%s], but got [%s]" (join ", " $allowedModes) .) -}}
{{- end -}}
{{- end -}}
{{- if eq $.Values.chiaConfig.service "harvester" -}}
{{- $reqs := list "farmer_address" "farmer_port" "ca" -}}
{{- range $key := $reqs -}}
{{- if not (get $.Values.chiaConfig $key) -}}
{{- fail (printf "Expected non-empty <%s> when <node_mode> is set to <harvester>" $key) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}