Skip to content

Commit

Permalink
Fix ArgoCD diff on postgresql keys (cloudnative-pg#441)
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammad Bozorgmehr <[email protected]>
Signed-off-by: Itay Grudev <[email protected]>
Co-authored-by: Mohammad Bozorgmehr <[email protected]>
Co-authored-by: Itay Grudev <[email protected]>
  • Loading branch information
3 people authored and hapeho committed Dec 18, 2024
1 parent 24254f7 commit fcc29bc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
2 changes: 2 additions & 0 deletions charts/cluster/templates/_bootstrap.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ bootstrap:
{{- if .Values.cluster.initdb.owner }}
owner: {{ tpl .Values.cluster.initdb.owner . }}
{{- end }}
{{- if or (eq .Values.type "postgis") (eq .Values.type "timescaledb") (not (empty .Values.cluster.initdb.postInitApplicationSQL)) }}
postInitApplicationSQL:
{{- if eq .Values.type "postgis" }}
- CREATE EXTENSION IF NOT EXISTS postgis;
Expand All @@ -24,6 +25,7 @@ bootstrap:
{{- printf "- %s" . | nindent 6 }}
{{- end -}}
{{- end -}}
{{- end }}
{{- else if eq .Values.mode "recovery" -}}
bootstrap:
{{- if eq .Values.recovery.method "pg_basebackup" }}
Expand Down
28 changes: 21 additions & 7 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ spec:
postgresGID: {{ include "cluster.postgresGID" . }}
storage:
size: {{ .Values.cluster.storage.size }}
{{- if not (empty .Values.cluster.storage.storageClass) }}
storageClass: {{ .Values.cluster.storage.storageClass }}
{{- if .Values.cluster.walStorage.enabled }}
{{- end }}
{{- if .Values.cluster.walStorage.enabled }}
walStorage:
size: {{ .Values.cluster.walStorage.size }}
{{- if not (empty .Values.cluster.walStorage.storageClass) }}
storageClass: {{ .Values.cluster.walStorage.storageClass }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.cluster.resources }}
resources:
{{- toYaml . | nindent 4 }}
Expand All @@ -43,7 +47,9 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}

{{- if .Values.cluster.priorityClassName }}
priorityClassName: {{ .Values.cluster.priorityClassName }}
{{- end }}

primaryUpdateMethod: {{ .Values.cluster.primaryUpdateMethod }}
primaryUpdateStrategy: {{ .Values.cluster.primaryUpdateStrategy }}
Expand All @@ -59,27 +65,35 @@ spec:
{{ end }}
enablePDB: {{ .Values.cluster.enablePDB }}
postgresql:
{{- if or (eq .Values.type "timescaledb") (not (empty .Values.cluster.postgresql.shared_preload_libraries)) }}
shared_preload_libraries:
{{- if eq .Values.type "timescaledb" }}
- timescaledb
{{- end }}
{{- with .Values.cluster.postgresql.shared_preload_libraries }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.cluster.postgresql }}
{{- end }}
{{- with .Values.cluster.postgresql.pg_hba }}
pg_hba:
{{- toYaml .pg_hba | nindent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.cluster.postgresql.pg_ident }}
pg_ident:
{{- toYaml .pg_ident | nindent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.cluster.postgresql.parameters }}
parameters:
{{- toYaml .parameters | nindent 6 }}
{{ end }}
{{- toYaml . | nindent 6 }}
{{- end }}

{{- if not (empty .Values.cluster.roles) }}
managed:
{{- with .Values.cluster.roles }}
roles:
{{- toYaml . | nindent 6 }}
{{ end }}
{{- end }}

{{- with .Values.cluster.serviceAccountTemplate }}
serviceAccountTemplate:
Expand Down

0 comments on commit fcc29bc

Please sign in to comment.