Skip to content

Commit 23704b0

Browse files
authored
Fix 12955 / Set default value of postgresql.postgresServer to 127.0.0.1 in helm chart (#12965)
* Set database hostname to 127.0.0.1 by default * Move and update comment about external instance in postgresql to ease the usage
1 parent c827224 commit 23704b0

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

helm/defectdojo/templates/_helpers.tpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ Create the name of the service account to use
4747
*/}}
4848
{{- define "postgresql.hostname" -}}
4949
{{- if .Values.postgresql.enabled -}}
50-
{{- if eq .Values.postgresql.architecture "replication" -}}
51-
{{- printf "%s-%s-%s" .Release.Name "postgresql" .Values.postgresql.primary.name | trunc 63 | trimSuffix "-" -}}
50+
{{- if eq .Values.postgresql.architecture "replication" -}}
51+
{{- printf "%s-%s-%s" .Release.Name "postgresql" .Values.postgresql.primary.name | trunc 63 | trimSuffix "-" -}}
52+
{{- else -}}
53+
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
54+
{{- end -}}
5255
{{- else -}}
53-
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
54-
{{- end -}}
55-
{{- else -}}
56-
{{- printf "%s" .Values.postgresql.postgresServer -}}
56+
{{- printf "%s" ( .Values.postgresql.postgresServer | default "127.0.0.1" ) -}}
5757
{{- end -}}
5858
{{- end -}}
5959
{{- define "redis.hostname" -}}

helm/defectdojo/values.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ initializer:
405405
staticName: false
406406

407407
postgresql:
408+
# To use an external PostgreSQL instance (like CloudSQL), set enabled to false, set items in auth part for authentication,
409+
# and uncomment the line below:
410+
# postgresServer: "127.0.0.1"
408411
enabled: true
409412
auth:
410413
username: defectdojo
@@ -444,10 +447,6 @@ postgresql:
444447
chmod:
445448
enabled: false
446449

447-
# To use an external PostgreSQL instance, set enabled to false and uncomment
448-
# the line below:
449-
# postgresServer: "127.0.0.1"
450-
451450
# Google CloudSQL support in GKE via gce-proxy
452451
cloudsql:
453452
# To use CloudSQL in GKE set 'enable: true'

0 commit comments

Comments
 (0)