Skip to content

Commit 3b049b7

Browse files
author
ohotnikov.ivan
committed
fix(postgres): address review feedback
- Regenerate deepcopy artifacts to remove orphaned PostgreSQLParameters methods - Update e2e test to use string value for max_connections parameter - Fix template to avoid .Values mutation and use quote function for safe YAML escaping Signed-off-by: ohotnikov.ivan <[email protected]>
1 parent 7144d89 commit 3b049b7

4 files changed

Lines changed: 16 additions & 20 deletions

File tree

‎api/apps/v1alpha1/postgresql/zz_generated.deepcopy.go‎

Lines changed: 8 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/backups/v1alpha1/zz_generated.deepcopy.go‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎hack/e2e-apps/postgres.bats‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
storageClass: ""
1717
postgresql:
1818
parameters:
19-
max_connections: 100
19+
max_connections: "100"
2020
quorum:
2121
minSyncReplicas: 0
2222
maxSyncReplicas: 0

‎packages/apps/postgres/templates/db.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ spec:
5858
postgresql:
5959
parameters:
6060
{{- $defaults := dict "max_wal_senders" "30" }}
61-
{{- $params := merge .Values.postgresql.parameters $defaults }}
61+
{{- $params := merge (dict) $defaults .Values.postgresql.parameters }}
6262
{{- /* Security: Block parameters that could allow shell command execution */ -}}
6363
{{- $dangerousParams := list "archive_command" "restore_command" "ssl_passphrase_command" "log_destination" "event_source" }}
6464
{{- range $key, $value := $params }}
6565
{{- if has $key $dangerousParams }}
6666
{{- fail (printf "SECURITY: Parameter '%s' is blocked for security reasons. This parameter could allow arbitrary shell command execution and is managed by CloudNativePG operator." $key) }}
6767
{{- end }}
68-
{{ $key }}: "{{ $value }}"
68+
{{ $key }}: {{ $value | quote }}
6969
{{- end }}
7070

7171
minSyncReplicas: {{ .Values.quorum.minSyncReplicas }}

0 commit comments

Comments
 (0)