Skip to content

fix(postgres): point the trust-anchor comment at the published projection - #4063

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/postgres-db-comment
Sep 6, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/postgres-db-comment

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

The TLS comment in db.yaml told operators to take ca.crt from <release>-credentials. That key is not there. The chart renders that Secret from .Values.users, so it holds passwords and nothing else.

The anchor a tenant can reach is <release>.tenant-ca, which the CA-extraction controller publishes from the sentinel this chart already renders in templates/tenant-projection.yaml, and which tenants read through tenantsecrets. The comment points there now. It also names the two Secrets it is not, because CNPG's own <release>-ca is one dash away and holds the CA private key next to ca.crt.

Comment only. README.md already documented the projection correctly and needed no change, and helm unittest packages/apps/postgres is green.

Screenshots

Not a UI change.

Downstream repositories

A comment inside one chart template. values.yaml, values.schema.json, Chart.yaml and README.md are untouched, so the generated reference page does not move, and no schema field, default, version enum, release prefix or Secret name changes.

Release note

NONE

Summary by CodeRabbit

  • Documentation
    • Updated TLS trust-anchor comments to clarify that the CA extraction controller publishes the key-free <release>.tenant-ca Secret.

…tion

The comment sent operators to a ca.crt key in <release>-credentials.
That Secret is rendered by this chart from .Values.users and carries
password entries only, so there is nothing in it to verify a server
certificate against.

The anchor a tenant can reach is the key-free <release>.tenant-ca that
the CA extraction controller publishes from the sentinel this chart
renders, delivered through the tenantsecrets API.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 5738277e-c739-4576-8bd9-8ceeb954ca07

📥 Commits

Reviewing files that changed from the base of the PR and between e94fcf8 and 0056e2c.

📒 Files selected for processing (1)
  • packages/apps/postgres/templates/db.yaml

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Updated PostgreSQL TLS documentation to reference the controller-published <release>.tenant-ca Secret and distinguish it from other CA and credentials Secrets. Template behavior remains unchanged.

Changes

PostgreSQL TLS documentation

Layer / File(s) Summary
Trust-anchor Secret references
packages/apps/postgres/templates/db.yaml
TLS comments now identify <release>.tenant-ca as the key-free trust-anchor Secret and distinguish it from chart-managed credentials and CNPG’s <release>-ca Secret.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 0056e

This change corrects TLS Secret reference documentation without changing chart behavior. No current merge-readiness risk remains.

Suggested reviewers: androndo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the PostgreSQL change: it updates the trust-anchor comment to reference the published projection.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/postgres-db-comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size/XS This PR changes 0-9 lines, ignoring generated files area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) kind/bug Categorizes issue or PR as related to a bug labels Sep 3, 2026
@lexfrei
Aleksei Sviridkin (lexfrei) marked this pull request as ready for review September 3, 2026 21:44
IvanHunters
IvanHunters previously approved these changes Sep 4, 2026

@IvanHunters IvanHunters left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by #4063 (review), which states the same conclusion in a fraction of the space. The original text is removed rather than left as a second copy of the same review.

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict

LGTM

The old text told the reader to take ca.crt from <release>-credentials. That Secret is rendered at packages/apps/postgres/templates/init-script.yaml:18-27 from .Values.users, keyed by username, so the key was never there. The new text points at <release>.tenant-ca, which is what the CA controller actually publishes.

Checked the replacement rather than trusting it: the projection name comes from internal/controller/cacert/reconciler.go:354, and pkg/registry/apps/application/rest.go:275 builds the HelmRelease name with no releaseName override, so <release> means the same string in all three names the comment uses. packages/system/postgres-rd/cozyrds/postgres.yaml:45-46 and the base and use tiers in cozystack-basics make the anchor reachable to a tenant. Rendering the chart at base and at head across seven value combinations produced byte-identical output, so nothing reaches the apiserver differently.

Recommended follow-ups

  • The block uses #, which Helm copies into every rendered Cluster, while the backup rationale lower in the same file uses {{/* */}} and is stripped. Worth switching while someone is in here.
  • The same explanation now lives in README.md:178-190 and in db.yaml:20-25 with nothing keeping them in sync. The README is the copy a tenant reads.

@IvanHunters
IvanHunters dismissed their stale review September 4, 2026 17:41

Superseded by the inline review linked above.

@lexfrei
Aleksei Sviridkin (lexfrei) merged commit cd675e1 into main Sep 6, 2026
21 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the fix/postgres-db-comment branch September 6, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/database Issues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse) kind/bug Categorizes issue or PR as related to a bug size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants