Repository navigation
[Backport release-1.3] feat(postgres)!: support all PostgreSQL configuration parameters - #2595
Closed
github-actions[bot] wants to merge 12 commits into
Closed
github-actions[bot] wants to merge 12 commits into
github-actions[bot] wants to merge 12 commits into
Conversation
Allow users to configure any PostgreSQL server parameter via the postgresql.parameters field. All parameter values must be provided as strings (numeric values should be quoted). Security measures: - Block parameters that allow shell command execution (archive_command, restore_command, ssl_passphrase_command, log_destination, event_source) - Validation implemented in templates to prevent security vulnerabilities Generated files updated: - types.go: Add Parameters field with map[string]string type - README.md: Add parameter documentation and warnings - values.schema.json: Update schema for new field - CRD: Update OpenAPI schema with new field and reordered properties CloudNativePG manages certain parameters automatically (archive_mode, primary_conninfo, wal_level). Users should not override these as it may break backup/replication functionality. Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit fb0ed08)
- 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]> (cherry picked from commit f8001e2)
Fix regression where defaults were overriding user-supplied parameters. Sprig merge gives precedence to first argument, so user values must be merged before defaults to maintain correct override behavior. Before: merge (dict) $defaults .Values.postgresql.parameters After: merge (dict) .Values.postgresql.parameters $defaults Now max_wal_senders and other user parameters correctly override defaults. Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit 96c7c16)
PostgreSQL parameter names are case-insensitive, but the denylist check was case-sensitive, allowing bypass via mixed-case names (e.g., ARCHIVE_COMMAND instead of archive_command). Normalize parameter names to lowercase before checking against the denylist to prevent security bypass. Thanks to CodeRabbit for catching this security issue. Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit fac0622)
…theusRule
Helm was trying to evaluate {{ $labels.xxx }} as Helm variables, causing
"undefined variable" errors during E2E tests. Wrap Prometheus template
expressions in backticks to pass them through Helm unchanged.
Signed-off-by: IvanHunters <[email protected]>
(cherry picked from commit a753088)
Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit c2bad2a)
…d 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]> (cherry picked from commit 6ec761f)
Remove log_destination and event_source (not code-execution vectors). Add dynamic_library_path, local_preload_libraries, session_preload_libraries, shared_preload_libraries which allow loading arbitrary .so files. Improve error message accuracy. Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit 97d8f84)
… postgres Revert the kubevirt-operator PrometheusRule changes that were included in this PR by mistake. These changes will be submitted in a separate PR for cleaner attribution. Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit a4d3c99)
Update values.yaml comments and README to reflect the corrected denylist: remove log_destination and event_source (not code-execution vectors), add dynamic_library_path and *_preload_libraries (arbitrary .so loading). Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit 95f7be7)
Update description in values.yaml with corrected denylist and re-run cozyvalues-gen to propagate changes to values.schema.json, README.md, and types.go. Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit 53caea3)
Signed-off-by: IvanHunters <[email protected]> (cherry picked from commit fe6b448)
myasnikovdaniil
marked this pull request as draft
May 8, 2026 03:55
Contributor
|
Too dangerous to be backported. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #2466 to
release-1.3.