Skip to content

Commit d1f2cc6

Browse files
ixxeL2097Frederic Spiersgithub-actions[bot]
authored
feat(pgsql): merged initscript to avoid mount error, fixed quote from… (#13)
* feat(pgsql): merged initscript to avoid mount error, fixed quote from preloadlibrary and ajusted custom mount for init scripts * Update CHANGELOG.md Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Frederic Spiers <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent a2c25f3 commit d1f2cc6

File tree

7 files changed

+122
-52
lines changed

7 files changed

+122
-52
lines changed

charts/postgres/CHANGELOG.md

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,90 @@
11
# Changelog
22

3-
## 0.7.2 (2025-10-05)
3+
## 0.8.0 (2025-10-07)
44

5-
* [mariadb] use tpl to return existingConfigMap ([#217](https://github.com/CloudPirates-io/helm-charts/pull/217))
5+
* feat(pgsql): merged initscript to avoid mount error, fixed quote from… ([#13](https://github.com/GitGuardian/gitguardian-helm-charts/pull/13))
6+
7+
## 0.7.0 (2025-09-30)
8+
9+
* make postgres run on openshift (#184) ([0396895](https://github.com/GitGuardian/gitguardian-helm-charts/commit/0396895)), closes [#184](https://github.com/GitGuardian/gitguardian-helm-charts/issues/184)
10+
11+
## <small>0.6.1 (2025-09-29)</small>
12+
13+
* update default postgres config files (#180) ([6385512](https://github.com/GitGuardian/gitguardian-helm-charts/commit/6385512)), closes [#180](https://github.com/GitGuardian/gitguardian-helm-charts/issues/180)
14+
15+
## <small>0.5.5 (2025-09-29)</small>
16+
17+
* [postgres]: Default config (#163) ([fc0da25](https://github.com/GitGuardian/gitguardian-helm-charts/commit/fc0da25)), closes [#163](https://github.com/GitGuardian/gitguardian-helm-charts/issues/163)
18+
19+
## 0.6.0 (2025-09-26)
20+
21+
* [postgres]: Fix invalid data dir path on postgres 18 (#165) ([7592892](https://github.com/GitGuardian/gitguardian-helm-charts/commit/7592892)), closes [#165](https://github.com/GitGuardian/gitguardian-helm-charts/issues/165)
22+
23+
## <small>0.5.4 (2025-09-26)</small>
24+
25+
* chore(deps): update docker.io/postgres:17.6 Docker digest to 0b6428e (#161) ([1946296](https://github.com/GitGuardian/gitguardian-helm-charts/commit/1946296)), closes [#161](https://github.com/GitGuardian/gitguardian-helm-charts/issues/161)
26+
27+
## <small>0.5.3 (2025-09-25)</small>
28+
29+
* add support for custom user at initialisation with password and database ([62d9d0d](https://github.com/GitGuardian/gitguardian-helm-charts/commit/62d9d0d))
30+
* add support for extra env vars from secret ([f6bb0dc](https://github.com/GitGuardian/gitguardian-helm-charts/commit/f6bb0dc))
31+
* bump chart version to 0.5.2 ([8c80572](https://github.com/GitGuardian/gitguardian-helm-charts/commit/8c80572))
32+
* bump chart version to 0.5.3 ([337480c](https://github.com/GitGuardian/gitguardian-helm-charts/commit/337480c))
33+
* bump chartversion to 0.3.0 ([9e0454c](https://github.com/GitGuardian/gitguardian-helm-charts/commit/9e0454c))
34+
* chore: add support for db initialization scripts ([96c8215](https://github.com/GitGuardian/gitguardian-helm-charts/commit/96c8215))
35+
* chore: add support for passing extra environment variables ([0951fdc](https://github.com/GitGuardian/gitguardian-helm-charts/commit/0951fdc))
36+
* chore: add support for persistentVolumeClaimRetentionPolicy ([2f73cfb](https://github.com/GitGuardian/gitguardian-helm-charts/commit/2f73cfb))
37+
* chore: bump version ([33105e9](https://github.com/GitGuardian/gitguardian-helm-charts/commit/33105e9))
38+
* chore(deps): update docker.io/postgres:17.6 Docker digest to 0f4f200 ([6f0746a](https://github.com/GitGuardian/gitguardian-helm-charts/commit/6f0746a))
39+
* chore(deps): update docker.io/postgres:17.6 Docker digest to 8a56bef ([3546801](https://github.com/GitGuardian/gitguardian-helm-charts/commit/3546801))
40+
* chore(deps): update docker.io/postgres:17.6 Docker digest to feff5b2 ([8b89eda](https://github.com/GitGuardian/gitguardian-helm-charts/commit/8b89eda))
41+
* fix admin postgres-password env-variable ([7b89fa4](https://github.com/GitGuardian/gitguardian-helm-charts/commit/7b89fa4))
42+
* fix: Change default name for CUSTOM_PASSWORD ([f7e74dd](https://github.com/GitGuardian/gitguardian-helm-charts/commit/f7e74dd))
43+
* support custom pg_hba.conf (#157) ([9f3ceea](https://github.com/GitGuardian/gitguardian-helm-charts/commit/9f3ceea)), closes [#157](https://github.com/GitGuardian/gitguardian-helm-charts/issues/157)
44+
* update env-vars, initialisation values, remove unused auth values ([11a6947](https://github.com/GitGuardian/gitguardian-helm-charts/commit/11a6947))
45+
* add extraObject array to all charts ([34772b7](https://github.com/GitGuardian/gitguardian-helm-charts/commit/34772b7))
46+
* Add initial Changelogs to all Charts ([68f10ca](https://github.com/GitGuardian/gitguardian-helm-charts/commit/68f10ca))
47+
* bump chart version ([fc9c564](https://github.com/GitGuardian/gitguardian-helm-charts/commit/fc9c564))
48+
* Bump chart version ([2907796](https://github.com/GitGuardian/gitguardian-helm-charts/commit/2907796))
49+
* Bump chart version ([9bd67d6](https://github.com/GitGuardian/gitguardian-helm-charts/commit/9bd67d6))
50+
* Bump chart version ([492acc9](https://github.com/GitGuardian/gitguardian-helm-charts/commit/492acc9))
51+
* bump postgres ([4cc47f2](https://github.com/GitGuardian/gitguardian-helm-charts/commit/4cc47f2))
52+
* Update CHANGELOG.md ([7749beb](https://github.com/GitGuardian/gitguardian-helm-charts/commit/7749beb))
53+
* Update CHANGELOG.md ([b1ce7c7](https://github.com/GitGuardian/gitguardian-helm-charts/commit/b1ce7c7))
54+
* Update CHANGELOG.md ([7df85ea](https://github.com/GitGuardian/gitguardian-helm-charts/commit/7df85ea))
55+
* Update CHANGELOG.md ([3ac9592](https://github.com/GitGuardian/gitguardian-helm-charts/commit/3ac9592))
56+
* Update CHANGELOG.md ([574c9dc](https://github.com/GitGuardian/gitguardian-helm-charts/commit/574c9dc))
57+
* Update CHANGELOG.md ([9c7f377](https://github.com/GitGuardian/gitguardian-helm-charts/commit/9c7f377))
58+
* Update CHANGELOG.md ([ee72020](https://github.com/GitGuardian/gitguardian-helm-charts/commit/ee72020))
59+
* Update CHANGELOG.md ([8baa18d](https://github.com/GitGuardian/gitguardian-helm-charts/commit/8baa18d))
60+
* Update CHANGELOG.md ([3e90557](https://github.com/GitGuardian/gitguardian-helm-charts/commit/3e90557))
61+
* Update CHANGELOG.md ([65522d2](https://github.com/GitGuardian/gitguardian-helm-charts/commit/65522d2))
62+
* Update CHANGELOG.md ([0a89918](https://github.com/GitGuardian/gitguardian-helm-charts/commit/0a89918))
63+
* Update CHANGELOG.md ([b82862d](https://github.com/GitGuardian/gitguardian-helm-charts/commit/b82862d))
64+
* Update docker.io/postgres:17.6 Docker digest to 29574e2 ([1226760](https://github.com/GitGuardian/gitguardian-helm-charts/commit/1226760))
65+
66+
## <small>0.2.1 (2025-08-26)</small>
67+
68+
* add first draft of postgres helm-chart ([ac297fa](https://github.com/GitGuardian/gitguardian-helm-charts/commit/ac297fa))
69+
* add postgres-secret lookup ([e628c3f](https://github.com/GitGuardian/gitguardian-helm-charts/commit/e628c3f))
70+
* added support for service account configuration (#15) ([541a9df](https://github.com/GitGuardian/gitguardian-helm-charts/commit/541a9df)), closes [#15](https://github.com/GitGuardian/gitguardian-helm-charts/issues/15)
71+
* fix common-parameter-test image tag ([5773314](https://github.com/GitGuardian/gitguardian-helm-charts/commit/5773314))
72+
* fix statefulset annotations ([b6cd6b8](https://github.com/GitGuardian/gitguardian-helm-charts/commit/b6cd6b8))
73+
* update chart to statefulset ([5a5b6ea](https://github.com/GitGuardian/gitguardian-helm-charts/commit/5a5b6ea))
74+
* Add ArtifactHub Badges to all Charts ([08b855b](https://github.com/GitGuardian/gitguardian-helm-charts/commit/08b855b))
75+
* Add ArtifactHub repo config ([15180a8](https://github.com/GitGuardian/gitguardian-helm-charts/commit/15180a8))
76+
* Add cosign signature READMEs ([5f82e7f](https://github.com/GitGuardian/gitguardian-helm-charts/commit/5f82e7f))
77+
* Add extensive chart testing ([a46efac](https://github.com/GitGuardian/gitguardian-helm-charts/commit/a46efac))
78+
* Add generated values.schema.json files from values.yaml ([aa79ac3](https://github.com/GitGuardian/gitguardian-helm-charts/commit/aa79ac3))
79+
* add logos to helm-charts ([fc70cdc](https://github.com/GitGuardian/gitguardian-helm-charts/commit/fc70cdc))
80+
* Fix image tag/digest handling ([a5c982b](https://github.com/GitGuardian/gitguardian-helm-charts/commit/a5c982b))
81+
* Fix imagePullSecrets format and pull always ([ce0d301](https://github.com/GitGuardian/gitguardian-helm-charts/commit/ce0d301))
82+
* fix readme.md install text, update chart.yaml home-website ([3511582](https://github.com/GitGuardian/gitguardian-helm-charts/commit/3511582))
83+
* Format README files ([04aacab](https://github.com/GitGuardian/gitguardian-helm-charts/commit/04aacab))
84+
* Release new chart versions / update sources ([dbb0e45](https://github.com/GitGuardian/gitguardian-helm-charts/commit/dbb0e45))
85+
* Remove leading $ from code blocks ([836b2e3](https://github.com/GitGuardian/gitguardian-helm-charts/commit/836b2e3))
86+
* Update docker.io/postgres Docker tag to v17.6 ([68b8e32](https://github.com/GitGuardian/gitguardian-helm-charts/commit/68b8e32))
87+
* Update postgres to 17.6 ([52b6e17](https://github.com/GitGuardian/gitguardian-helm-charts/commit/52b6e17))
88+
* update readme, chart.yaml texts and descriptions ([0179046](https://github.com/GitGuardian/gitguardian-helm-charts/commit/0179046))
89+
* Use existing secret ([024bd0f](https://github.com/GitGuardian/gitguardian-helm-charts/commit/024bd0f))
90+
* fix: chart icon urls ([cc38c0d](https://github.com/GitGuardian/gitguardian-helm-charts/commit/cc38c0d))

charts/postgres/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: postgres
33
description: The World's Most Advanced Open Source Relational Database
44
type: application
5-
version: 0.7.2
5+
version: 0.8.0
66
appVersion: "18.0"
77
keywords:
88
- postgres

charts/postgres/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ data:
110110
111111
# Shared Libraries
112112
{{- if .Values.config.postgresqlSharedPreloadLibraries }}
113-
shared_preload_libraries = {{ .Values.config.postgresqlSharedPreloadLibraries | quote }}
113+
shared_preload_libraries = {{ .Values.config.postgresqlSharedPreloadLibraries | squote }}
114114
{{- end }}
115115
116116
# Locale and Formatting

charts/postgres/templates/init-custom-user-configmap.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

charts/postgres/templates/initialization-configmap.yaml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.initdb.scripts (not .Values.initdb.scriptsConfigMap) }}
1+
{{- if or (and .Values.initdb.scripts (not .Values.initdb.scriptsConfigMap)) (and .Values.customUser (or .Values.customUser.name .Values.customUser.existingSecret)) }}
22
apiVersion: v1
33
kind: ConfigMap
44
metadata:
@@ -10,5 +10,29 @@ metadata:
1010
annotations:
1111
{{- include "postgres.annotations" . | nindent 4 }}
1212
{{- end }}
13-
data: {{- include "common.tplvalues.render" (dict "value" .Values.initdb.scripts "context" .) | nindent 2 }}
14-
{{- end }}
13+
data:
14+
{{- if and .Values.customUser (or .Values.customUser.name .Values.customUser.existingSecret) }}
15+
00-init-custom-user.sh: |
16+
#!/bin/sh
17+
18+
if [ -z "$CUSTOM_DB" ] && [ -z "$CUSTOM_USER" ] && [ -z "$CUSTOM_PASSWORD" ]; then
19+
echo "No custom user configuration found, skipping..."
20+
exit 0
21+
fi
22+
23+
set -e
24+
echo "Creating custom user: $CUSTOM_USER and database: $CUSTOM_DB"
25+
26+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -v DATABASENAME="$CUSTOM_DB" -v USERNAME="$CUSTOM_USER" -v PASSWORD="'$CUSTOM_PASSWORD'" <<-EOSQL
27+
CREATE USER :USERNAME WITH PASSWORD :PASSWORD;
28+
CREATE DATABASE :DATABASENAME;
29+
GRANT ALL PRIVILEGES ON DATABASE :DATABASENAME TO :USERNAME;
30+
ALTER DATABASE :DATABASENAME OWNER TO :USERNAME;
31+
EOSQL
32+
33+
echo "✅ Custom user and database created successfully!"
34+
{{- end }}
35+
{{- if .Values.initdb.scripts }}
36+
{{- include "common.tplvalues.render" (dict "value" .Values.initdb.scripts "context" .) | nindent 2 }}
37+
{{- end }}
38+
{{- end }}

charts/postgres/templates/statefulset.yaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,9 @@ spec:
184184
mountPath: {{ include "postgres.runDir" . }}
185185
- name: tmp
186186
mountPath: /tmp
187-
{{- if or .Values.initdb.scriptsConfigMap .Values.initdb.scripts }}
187+
{{- if or .Values.initdb.scriptsConfigMap .Values.initdb.scripts (and .Values.customUser (or .Values.customUser.name .Values.customUser.existingSecret)) }}
188188
- name: custom-init-scripts
189-
mountPath: /docker-entrypoint-initdb.d/
190-
{{- end }}
191-
{{- if and .Values.customUser (or .Values.customUser.name .Values.customUser.existingSecret) }}
192-
- name: init-custom-user
193-
mountPath: /docker-entrypoint-initdb.d/init-custom-user.sh
194-
subPath: init-custom-user.sh
189+
mountPath: {{ .Values.initdb.directory }}
195190
{{- end }}
196191
volumes:
197192
{{- if not .Values.persistence.enabled }}
@@ -213,18 +208,11 @@ spec:
213208
emptyDir: {}
214209
- name: tmp
215210
emptyDir: {}
216-
{{- if or .Values.initdb.scriptsConfigMap .Values.initdb.scripts }}
211+
{{- if or .Values.initdb.scriptsConfigMap .Values.initdb.scripts (and .Values.customUser (or .Values.customUser.name .Values.customUser.existingSecret)) }}
217212
- name: custom-init-scripts
218213
configMap:
219214
name: {{ include "postgres.initdb.scriptsCM" . }}
220-
{{- end }}
221-
{{- if and .Values.customUser (or .Values.customUser.name .Values.customUser.existingSecret) }}
222-
- name: init-custom-user
223-
configMap:
224-
name: {{ printf "%s-init-custom-user" (include "postgres.fullname" .) }}
225-
items:
226-
- key: init-custom-user.sh
227-
path: init-custom-user.sh
215+
defaultMode: 0755
228216
{{- end }}
229217
{{- with .Values.nodeSelector }}
230218
nodeSelector:

charts/postgres/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ initdb:
126126
scripts: {}
127127
## @param initdb.scriptsConfigMap ConfigMap with scripts to be run at first boot
128128
scriptsConfigMap: ""
129+
## @param initdb.directory Directory where to load initScripts
130+
directory: "/docker-entrypoint-initdb.d/"
129131

130132
## @section Service configuration
131133
service:

0 commit comments

Comments
 (0)