Skip to content

Commit

Permalink
- Added func to replace any non alphanumeric chars to underscore into…
Browse files Browse the repository at this point in the history
… server name;
  • Loading branch information
Filipe-Souza committed Jan 25, 2024
1 parent d8f1c22 commit c0e5b9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chart/templates/configmaps.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $cPwd := randAlphaNum 12 | nospace -}}
{{- $sName := randAlphaNum 6 | nospace -}}
{{- $sName := "" -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -33,4 +33,8 @@ data:
COMMUNITY: "true"
SERVER_PASSWORD: {{- if .Values.server.config.community.password }} "{{ .Values.server.config.community.password }}" {{ else }} {{ $cPwd }} {{ end }}
{{ end }}
SERVER_NAME: {{- if .Values.server.config.server_name }} "{{ .Values.server.config.server_name }}" {{ else }} {{ printf "%s_%s" "palworld" $sName }} {{ end }}
{{ if .Values.server.config.server_name }}
SERVER_NAME: {{ regexReplaceAll "\\W+" .Values.server.config.server_name "_" }}
{{ else }}
SERVER_NAME: {{ printf "%s_%s" "palworld" (randAlphaNum 6 | nospace) }}
{{ end }}

0 comments on commit c0e5b9f

Please sign in to comment.