Skip to content

Commit f8001e2

Browse files
ohotnikov.ivanIvanHunters
authored andcommitted
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 fb0ed08 commit f8001e2

3 files changed

Lines changed: 11 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.

‎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
@@ -61,14 +61,14 @@ spec:
6161
postgresql:
6262
parameters:
6363
{{- $defaults := dict "max_wal_senders" "30" }}
64-
{{- $params := merge .Values.postgresql.parameters $defaults }}
64+
{{- $params := merge (dict) $defaults .Values.postgresql.parameters }}
6565
{{- /* Security: Block parameters that could allow shell command execution */ -}}
6666
{{- $dangerousParams := list "archive_command" "restore_command" "ssl_passphrase_command" "log_destination" "event_source" }}
6767
{{- range $key, $value := $params }}
6868
{{- if has $key $dangerousParams }}
6969
{{- 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) }}
7070
{{- end }}
71-
{{ $key }}: "{{ $value }}"
71+
{{ $key }}: {{ $value | quote }}
7272
{{- end }}
7373

7474
minSyncReplicas: {{ .Values.quorum.minSyncReplicas }}

0 commit comments

Comments
 (0)