Files
chart/library/ix-dev/community/chia/templates/_validation.tpl
Stavros Kois 275657f0c3 NAS-121031 / None / Add chia to community train (#1031)
* add chia to community train

* dummy commit

* add update_strategy
2023-03-20 17:34:29 +02: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 -}}