[postgres-operator] Update to v1.27.3 - #2226
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughBumps cloudnative-pg chart/app versions; adds topologySpreadConstraints, updateStrategy, and webhook startupProbe; expands RBAC (failoverquorums, imagecatalogs, status subresources); adds database admission webhooks; switches namespace rendering to helper; updates monitoring queries and license headers. Changes
Sequence Diagram(s)sequenceDiagram
participant KAS as Kubernetes API Server
participant WebhookSvc as cloudnative-pg Service
participant WebhookPod as webhook Container
participant Controller as cloudnative-pg Controller
KAS->>WebhookSvc: Admission POST /mutate or /validate (admissionReview v1)
WebhookSvc->>WebhookPod: forward admission request
WebhookPod->>WebhookPod: evaluate rules (db/cluster/backup)
WebhookPod-->>WebhookSvc: admissionReview response
WebhookSvc-->>KAS: admissionReview response
KAS->>Controller: Event / reconcile (resource created/updated)
Controller->>KAS: update status (may include failoverquorums/status)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a significant upgrade of the CloudNativePG operator, bringing it to version 1.27.3. The update encompasses not only version bumps for the operator image and Helm chart but also introduces several new features and improvements. These include advanced deployment controls, refined webhook configurations, and extended monitoring capabilities, all aimed at improving the operator's robustness and observability within a Kubernetes environment. The changes also standardize license information across the codebase. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully updates the CloudNativePG operator to version v1.27.3, along with chart version 0.27.1 and app version 1.28.1. The changes include updates to Chart.lock, Chart.yaml, and README.md to reflect the new versions. Additionally, new configurations for startupProbe, updateStrategy, and topologySpreadConstraints have been introduced in values.yaml and their corresponding schema in values.schema.json. RBAC rules and webhook configurations have been extended to support new resources like failoverquorums, imagecatalogs, and clusterimagecatalogs. Several templates (NOTES.txt, deployment.yaml, mutatingwebhookconfiguration.yaml, rbac.yaml, validatingwebhookconfiguration.yaml) have been updated to use the cloudnative-pg.namespace helper for consistency. Copyright headers have been updated, and SPDX license identifiers have been added to various files, improving license clarity. Minor formatting adjustments and a typo correction in README.md also contribute to overall code quality. All changes are consistent with an operator upgrade and introduce valuable new features and improvements.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/system/postgres-operator/charts/cloudnative-pg/README.md`:
- Line 60: The table row for monitoringQueriesConfigMap.queries injects the full
YAML (with many | pipe characters) into the cell which breaks Markdown table
parsing; replace the cell value with a short placeholder like "See values.yaml
for full default" and move the entire YAML payload currently embedded in that
cell into a fenced code block (triple backticks, YAML) placed immediately after
the table (or in a "Defaults" section) so the README renders correctly;
specifically update the README entry for monitoringQueriesConfigMap.queries and
add the full YAML as a separate fenced block below the table.
In
`@packages/system/postgres-operator/charts/cloudnative-pg/templates/config.yaml`:
- Around line 2-3: This change modifies a vendored upstream chart template
(cloudnative-pg config.yaml) directly; instead of editing
packages/system/postgres-operator/charts/cloudnative-pg/templates/config.yaml by
hand, revert this direct edit and apply the header/comment change via the chart
vendoring/update mechanism (e.g., update the cloudnative-pg dependency or the
chart vendor tooling you use) so the upstream chart is updated cleanly and the
vendored templates remain unmodified.
In `@packages/system/postgres-operator/charts/cloudnative-pg/values.yaml`:
- Around line 29-30: The vendored cloudnative-pg chart should not be edited
directly (remove the hardcoded image.tag "1.27.3" in the vendored values);
instead either vendor a chart version that matches the operator (e.g., use the
cloudnative-pg chart matching operator 1.27.3 rather than chart 0.27.1) or apply
an image override at the umbrella/parent chart layer using the umbrella chart's
values override mechanism (set the cloudnative-pg image.tag via the parent chart
values.yaml or Helm --set for dependencyOverrides) so chart rendering and
operator image remain in sync and you avoid modifying files under the vendored
chart.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 919759f4-08fa-4e97-b38d-66f9e90279eb
⛔ Files ignored due to path filters (1)
packages/system/postgres-operator/charts/cloudnative-pg/Chart.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
packages/system/postgres-operator/charts/cloudnative-pg/Chart.yamlpackages/system/postgres-operator/charts/cloudnative-pg/README.mdpackages/system/postgres-operator/charts/cloudnative-pg/templates/NOTES.txtpackages/system/postgres-operator/charts/cloudnative-pg/templates/_helpers.tplpackages/system/postgres-operator/charts/cloudnative-pg/templates/config.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/crds/crds.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/deployment.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/monitoring-configmap.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/mutatingwebhookconfiguration.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/podmonitor.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/rbac.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/service.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/validatingwebhookconfiguration.yamlpackages/system/postgres-operator/charts/cloudnative-pg/values.schema.jsonpackages/system/postgres-operator/charts/cloudnative-pg/values.yaml
| # Copyright © contributors to CloudNativePG, established as | ||
| # CloudNativePG a Series of LF Projects, LLC. |
There was a problem hiding this comment.
Avoid direct edits in vendored upstream chart templates
This file is inside a vendored chart (packages/system/postgres-operator/charts/cloudnative-pg/...), so these header/comment changes should be applied through the chart vendoring/update mechanism, not by directly editing vendored YAML files.
As per coding guidelines: **/*.yaml: "Do NOT directly edit upstream Helm charts in vendored charts directory; use proper chart vendoring mechanisms".
Also applies to: 17-18
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@packages/system/postgres-operator/charts/cloudnative-pg/templates/config.yaml`
around lines 2 - 3, This change modifies a vendored upstream chart template
(cloudnative-pg config.yaml) directly; instead of editing
packages/system/postgres-operator/charts/cloudnative-pg/templates/config.yaml by
hand, revert this direct edit and apply the header/comment change via the chart
vendoring/update mechanism (e.g., update the cloudnative-pg dependency or the
chart vendor tooling you use) so the upstream chart is updated cleanly and the
vendored templates remain unmodified.
|
dmpopof (@dmpopoff) please fix DCO |
Signed-off-by: Dmitrii Popov <dmpopof@gmail.com>
8ac8542 to
1edbb4a
Compare
|
"make apply" was successful, desired image deployed. Should the image be specified in the vendor chart values file, which is being used for now or in the package's values? I suggest using version 1.27.3 for now, as it is more stable; the 1.28 branch includes significant changes that have not yet been fully tested. |
There was a problem hiding this comment.
♻️ Duplicate comments (2)
packages/system/postgres-operator/charts/cloudnative-pg/values.yaml (1)
29-30:⚠️ Potential issue | 🟠 MajorMove the operator tag override out of the vendored chart values.
Line 30 hardcodes
image.taginside the vendoredcharts/cloudnative-pgvalues, which should be kept upstream-clean and overridden from the umbrella chart layer instead.Read-only verification steps
#!/bin/bash set -euo pipefail echo "Local vendored chart metadata:" sed -n '1,40p' packages/system/postgres-operator/charts/cloudnative-pg/Chart.yaml | rg -n '^(version|appVersion):' echo echo "Local vendored image values:" sed -n '24,34p' packages/system/postgres-operator/charts/cloudnative-pg/values.yaml echo echo "Upstream cloudnative-pg v0.27.1 image defaults:" curl -fsSL https://raw.githubusercontent.com/cloudnative-pg/charts/cloudnative-pg-v0.27.1/charts/cloudnative-pg/values.yaml \ | rg -n -A2 -B2 'Overrides the image tag whose default is the chart appVersion|^\s*tag:' echo echo "Search for non-vendored override locations in this repo:" rg -n --type=yaml 'cloudnative-pg:|image:\s*$|tag:\s*"?1\.27\.3"?'As per coding guidelines:
**/*.yaml: "Do NOT directly edit upstream Helm charts in vendored charts directory; use proper chart vendoring mechanisms".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/system/postgres-operator/charts/cloudnative-pg/values.yaml` around lines 29 - 30, The vendored chart's values.yaml hardcodes image.tag ("tag: \"1.27.3\"") which must not be edited in-place; remove the hardcoded image.tag entry from packages/system/postgres-operator/charts/cloudnative-pg/values.yaml and instead set image.tag in the umbrella/parent chart values (the override location that deploys cloudnative-pg) so the vendored cloudnative-pg chart remains upstream-clean; ensure the override uses the same key path (image.tag) when adding it to the parent chart's values.yaml.packages/system/postgres-operator/charts/cloudnative-pg/README.md (1)
60-60:⚠️ Potential issue | 🟡 MinorFix broken table row rendering for
monitoringQueriesConfigMap.queries(still unresolved).Line 60 embeds a long YAML payload containing many
|tokens inside a Markdown table cell, which breaks column parsing and truncates rendering.Suggested fix
-| monitoringQueriesConfigMap.queries | string | "<full escaped YAML...>" | A string representation of a YAML defining monitoring queries. | +| monitoringQueriesConfigMap.queries | string | `"See values.yaml for full default"` | A string representation of YAML defining monitoring queries. |Then place the full default value in a fenced
yamlblock immediately below the table (or in a## Defaultssection), so docs render correctly while preserving the full content.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/system/postgres-operator/charts/cloudnative-pg/README.md` at line 60, The table cell for monitoringQueriesConfigMap.queries contains a large YAML payload with many pipe (|) blocks which breaks Markdown table parsing; remove the long YAML value from the table row and instead replace the table cell with a short note (e.g. "See Defaults below") and move the full YAML default into a separate fenced ```yaml``` block (or a "## Defaults" section) placed immediately below the table so the file renders correctly; update any surrounding text to reference monitoringQueriesConfigMap.queries and ensure the moved content is identical to the original string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/system/postgres-operator/charts/cloudnative-pg/README.md`:
- Line 60: The table cell for monitoringQueriesConfigMap.queries contains a
large YAML payload with many pipe (|) blocks which breaks Markdown table
parsing; remove the long YAML value from the table row and instead replace the
table cell with a short note (e.g. "See Defaults below") and move the full YAML
default into a separate fenced ```yaml``` block (or a "## Defaults" section)
placed immediately below the table so the file renders correctly; update any
surrounding text to reference monitoringQueriesConfigMap.queries and ensure the
moved content is identical to the original string.
In `@packages/system/postgres-operator/charts/cloudnative-pg/values.yaml`:
- Around line 29-30: The vendored chart's values.yaml hardcodes image.tag ("tag:
\"1.27.3\"") which must not be edited in-place; remove the hardcoded image.tag
entry from packages/system/postgres-operator/charts/cloudnative-pg/values.yaml
and instead set image.tag in the umbrella/parent chart values (the override
location that deploys cloudnative-pg) so the vendored cloudnative-pg chart
remains upstream-clean; ensure the override uses the same key path (image.tag)
when adding it to the parent chart's values.yaml.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d8273a24-a4de-4b89-9e7a-1904f9d6cab2
⛔ Files ignored due to path filters (1)
packages/system/postgres-operator/charts/cloudnative-pg/Chart.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
packages/system/postgres-operator/charts/cloudnative-pg/Chart.yamlpackages/system/postgres-operator/charts/cloudnative-pg/README.mdpackages/system/postgres-operator/charts/cloudnative-pg/templates/NOTES.txtpackages/system/postgres-operator/charts/cloudnative-pg/templates/_helpers.tplpackages/system/postgres-operator/charts/cloudnative-pg/templates/config.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/crds/crds.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/deployment.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/monitoring-configmap.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/mutatingwebhookconfiguration.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/podmonitor.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/rbac.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/service.yamlpackages/system/postgres-operator/charts/cloudnative-pg/templates/validatingwebhookconfiguration.yamlpackages/system/postgres-operator/charts/cloudnative-pg/values.schema.jsonpackages/system/postgres-operator/charts/cloudnative-pg/values.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
- packages/system/postgres-operator/charts/cloudnative-pg/templates/podmonitor.yaml
- packages/system/postgres-operator/charts/cloudnative-pg/values.schema.json
- packages/system/postgres-operator/charts/cloudnative-pg/templates/NOTES.txt
- packages/system/postgres-operator/charts/cloudnative-pg/templates/_helpers.tpl
- packages/system/postgres-operator/charts/cloudnative-pg/templates/mutatingwebhookconfiguration.yaml
Signed-off-by: Dmitrii Popov <dmpopof@gmail.com>
|
chart version 0.27.1 is incompatible with operator 1.27.3 because of:
we should use chart for 1.27.x operator. Fixed in 845192b |
What this PR does
upgrades CNPG operator to v1.27.3
Used chart version 0.27.1. Image in default values set to 1.27.3. The default App version for this chart is 1.28.1.
Release note
Summary by CodeRabbit
New Features
Bug Fixes
Chores