Skip to content

Commit 6ec761f

Browse files
committed
fix(postgres): accept integer values in parameters schema for backward compat
Allow integer values in postgresql.parameters via anyOf schema, so existing HelmReleases with max_connections: 100 (integer) are not broken on upgrade. Template coerces all values to string via toString before quoting. Signed-off-by: IvanHunters <[email protected]>
1 parent c2bad2a commit 6ec761f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ spec:
6969
{{- if has $normalizedKey $dangerousParams }}
7070
{{- 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) }}
7171
{{- end }}
72-
{{ $key }}: {{ $value | quote }}
72+
{{ $key }}: {{ $value | toString | quote }}
7373
{{- end }}
7474

7575
minSyncReplicas: {{ .Values.quorum.minSyncReplicas }}

‎packages/apps/postgres/values.schema.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@
103103
"max_connections": "100"
104104
},
105105
"additionalProperties": {
106-
"type": "string"
106+
"anyOf": [
107+
{"type": "string"},
108+
{"type": "integer"}
109+
]
107110
}
108111
}
109112
}

0 commit comments

Comments
 (0)