Skip to content

Commit c32223f

Browse files
authored
Merge pull request #37 from noratanxz/postgres-auth
fix: postgres connection string to use db name set in values
2 parents 996db06 + c1d15d7 commit c32223f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

coder-observability/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Create the name of the service account to use
6464
{{/* Postgres connector string */}}
6565
{{- define "postgres-connector-string" -}}
6666
{{- if .Values.global.postgres.password -}}
67-
postgresql://{{ .Values.global.postgres.username }}:{{ urlquery .Values.global.postgres.password }}@{{ .Values.global.postgres.hostname }}:{{ .Values.global.postgres.port }}/postgres?sslmode={{ .Values.global.postgres.sslmode }}
67+
postgresql://{{ .Values.global.postgres.username }}:{{ urlquery .Values.global.postgres.password }}@{{ .Values.global.postgres.hostname }}:{{ .Values.global.postgres.port }}/{{ .Values.global.postgres.database }}?sslmode={{ .Values.global.postgres.sslmode }}
6868
{{- else if .Values.global.postgres.mountSecret -}}
69-
postgresql://{{ .Values.global.postgres.username }}@{{ .Values.global.postgres.hostname }}:{{ .Values.global.postgres.port }}/postgres?sslmode={{ .Values.global.postgres.sslmode }}
69+
postgresql://{{ .Values.global.postgres.username }}@{{ .Values.global.postgres.hostname }}:{{ .Values.global.postgres.port }}/{{ .Values.global.postgres.database }}?sslmode={{ .Values.global.postgres.sslmode }}
7070
{{- else -}}
7171
{{ fail "either postgres.password or postgres.mountSecret must be defined" }}
7272
{{- end -}}

compiled/resources.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ data:
994994
global:
995995
target:
996996
name: postgres
997-
data_source_name: 'postgresql://coder@localhost:5432/postgres?sslmode=disable'
997+
data_source_name: 'postgresql://coder@localhost:5432/coder?sslmode=disable'
998998
collectors:
999999
- notify
10001000
collectors:
@@ -12215,7 +12215,7 @@ spec:
1221512215
name: exporter
1221612216
env:
1221712217
- name: DATA_SOURCE_NAME
12218-
value: 'postgresql://coder@localhost:5432/postgres?sslmode=disable'
12218+
value: 'postgresql://coder@localhost:5432/coder?sslmode=disable'
1221912219
envFrom:
1222012220
- secretRef:
1222112221
name: secret-postgres
@@ -12270,7 +12270,7 @@ spec:
1227012270
metadata:
1227112271
annotations:
1227212272
prometheus.io/scrape: 'true'
12273-
checksum/config: e12c0044ef2cab3438ffdc8f5e16c24c5acf5ee36dcc8bee77294f27e53ce4a2
12273+
checksum/config: 71bb9e7579b6e138ae28c623aa29d72025be00387da6c1b8dd5aa168c96ca1e0
1227412274
labels:
1227512275
app: sql-exporter
1227612276
app.kubernetes.io/name: "database-stats"

0 commit comments

Comments
 (0)