_params.tpl 1.1 KB

1234567891011121314151617181920212223242526272829
  1. {{- define "palworld.set.params" -}}
  2. {{- range $param := .Values.palworldConfig.gameParams -}}
  3. {{- if hasPrefix "port=" $param -}}
  4. {{- fail "PalWorld - [port=] param is automatically adjusted from the Server Port field" -}}
  5. {{- end -}}
  6. {{- end -}}
  7. {{- $params := (prepend .Values.palworldConfig.gameParams (printf "port=%v" .Values.palworldNetwork.serverPort)) -}}
  8. {{- $_ := set .Values.palworldConfig "gameParams" $params -}}
  9. {{/* Handle upgrades from versions that did not had such dicts */}}
  10. {{- if not .Values.palworldConfig.server -}}
  11. {{- $_ := set .Values.palworldConfig "server" dict -}}
  12. {{- end -}}
  13. {{- if not .Values.palworldConfig.backup -}}
  14. {{- $_ := set .Values.palworldConfig "backup" dict -}}
  15. {{- end -}}
  16. {{- $reservedKeys := list
  17. "RCONEnabled" "RCONPort" "PublicPort" "ServerName"
  18. "ServerDescription" "ServerPassword" "AdminPassword" "AllowConnectPlatform"
  19. -}}
  20. {{- range $item := .Values.palworldConfig.iniKeys }}
  21. {{- if (mustHas $item.key $reservedKeys) -}}
  22. {{- fail (printf "PalWorld - [%v] is a reserved key." $item.key) -}}
  23. {{- end -}}
  24. {{- end -}}
  25. {{- end -}}