_params.tpl 773 B

123456789101112131415161718
  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. {{- end -}}