From c0e5b9fa66f6382d38084365ced867d65f4a0f00 Mon Sep 17 00:00:00 2001 From: Filipe Souza Date: Thu, 25 Jan 2024 01:51:27 -0300 Subject: [PATCH] - Added func to replace any non alphanumeric chars to underscore into server name; --- chart/templates/configmaps.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chart/templates/configmaps.yaml b/chart/templates/configmaps.yaml index 3ae6bbf57..4dea3bfc3 100644 --- a/chart/templates/configmaps.yaml +++ b/chart/templates/configmaps.yaml @@ -1,5 +1,5 @@ {{- $cPwd := randAlphaNum 12 | nospace -}} -{{- $sName := randAlphaNum 6 | nospace -}} +{{- $sName := "" -}} apiVersion: v1 kind: ConfigMap metadata: @@ -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 }} \ No newline at end of file + {{ 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 }} \ No newline at end of file