Files
chart/library/ix-dev/community/palworld/templates/_params.tpl
Stavros Kois c479033fc9 palworld - allow additional config (#2100)
* palworld - allow additional config

* bump version

* test actual keys

* dont print passwords

* handle bools

* lint

* handle bools

* only create dirs if not exist

* bypass bools on sh

* handle weird cases with quoting
2024-01-30 14:06:10 +02:00

30 lines
1.1 KiB
Smarty

{{- define "palworld.set.params" -}}
{{- range $param := .Values.palworldConfig.gameParams -}}
{{- if hasPrefix "port=" $param -}}
{{- fail "PalWorld - [port=] param is automatically adjusted from the Server Port field" -}}
{{- end -}}
{{- end -}}
{{- $params := (prepend .Values.palworldConfig.gameParams (printf "port=%v" .Values.palworldNetwork.serverPort)) -}}
{{- $_ := set .Values.palworldConfig "gameParams" $params -}}
{{/* Handle upgrades from versions that did not had such dicts */}}
{{- if not .Values.palworldConfig.server -}}
{{- $_ := set .Values.palworldConfig "server" dict -}}
{{- end -}}
{{- if not .Values.palworldConfig.backup -}}
{{- $_ := set .Values.palworldConfig "backup" dict -}}
{{- end -}}
{{- $reservedKeys := list
"RCONEnabled" "RCONPort" "PublicPort" "ServerName"
"ServerDescription" "ServerPassword" "AdminPassword"
-}}
{{- range $item := .Values.palworldConfig.iniKeys }}
{{- if (mustHas $item.key $reservedKeys) -}}
{{- fail (printf "PalWorld - [%v] is a reserved key." $item.key) -}}
{{- end -}}
{{- end -}}
{{- end -}}