diff --git a/pkg/helm/templates/_helpers.tpl b/pkg/helm/templates/_helpers.tpl index 3f78e71b14b..dd0e9af9531 100644 --- a/pkg/helm/templates/_helpers.tpl +++ b/pkg/helm/templates/_helpers.tpl @@ -25,4 +25,25 @@ {{- $securityContext = omit $securityContext "appArmorProfile" -}} {{- end -}} {{- $securityContext | toYaml -}} -{{- end -}} \ No newline at end of file +{{- end -}} + +{{- define "tpl.preserve.variable" -}} +{{- $obj := . }} +{{- if kindIs "map" $obj }} + {{- range $k, $v := $obj }} + {{- if kindIs "string" $v }} + {{- if regexMatch "^[0-9]+$" $v }} + {{- $_ := set $obj $k (atoi $v) }} + {{- else if regexMatch "(?i)^(true|false)$" $v }} + {{- $_ := set $obj $k (eq (lower $v) "true") }} + {{- end }} + {{- else }} + {{- include "tpl.preserve.variable" $v }} + {{- end }} + {{- end }} +{{- else if kindIs "slice" $obj }} + {{- range $i, $v := $obj }} + {{- include "tpl.preserve.variable" $v }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/pkg/helm/templates/configmap-serverDefinitions.yaml b/pkg/helm/templates/configmap-serverDefinitions.yaml index 4be08bd80ce..b501fe6dcde 100644 --- a/pkg/helm/templates/configmap-serverDefinitions.yaml +++ b/pkg/helm/templates/configmap-serverDefinitions.yaml @@ -10,5 +10,7 @@ metadata: annotations: {{ . | toYaml | nindent 4 }} {{- end }} data: - servers.json: | {{ tpl (dict "Servers" .Values.serverDefinitions.data | toYaml) . | fromYaml | toPrettyJson | nindent 4 }} +{{- $variableToPreserveTPL := tpl (dict "Servers" .Values.serverDefinitions.data | toYaml) . | fromYaml }} +{{- include "tpl.preserve.variable" $variableToPreserveTPL }} + servers.json: | {{ $variableToPreserveTPL | toYaml | nindent 4 }} {{- end }} \ No newline at end of file diff --git a/pkg/helm/templates/deployment.yaml b/pkg/helm/templates/deployment.yaml index 92fae167592..017094f23e5 100644 --- a/pkg/helm/templates/deployment.yaml +++ b/pkg/helm/templates/deployment.yaml @@ -117,7 +117,7 @@ spec: - name: PGADMIN_DISABLE_POSTFIX value: {{ .Values.disablePostfix | quote }} {{- with .Values.extraEnvVars }} - {{- tpl (. | toYaml) $ | nindent 14 }} + {{- tpl (. | toYaml) $ | nindent 12 }} {{- end }} volumeMounts: - mountPath: /var/lib/pgadmin @@ -234,4 +234,4 @@ spec: type: RuntimeDefault {{- end }} windowsOptions: - hostProcess: false \ No newline at end of file + hostProcess: false