Add failingHost to CustomRole status, drop noisy connect log#366
Merged
Add failingHost to CustomRole status, drop noisy connect log#366
Conversation
Surfaces which PostgreSQL host caused reconciliation to fail via status.failingHost, and removes the per-connect "Connecting to database" log line that fired on every reconcile cycle for every targeted database. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mahlunar
approved these changes
Apr 27, 2026
… check - Remove `log logr.Logger` from `postgres.Connect` — the only usage was the log line removed in the previous commit; update all call sites. - Extract the status-unchanged early-return in `persistStatus` into `CustomRoleStatus.IsUnchanged` per reviewer suggestion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
Invalid errors are spec-level and not host-specific; leaving failingHost set from a prior Failed reconcile would be misleading. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9d12464. Configure here.
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.
Summary
status.failingHosttoCustomRoleso operators can see which PostgreSQL host caused a reconcile failure without grepping controller logs.Connecting to databaselog line inpkg/postgres/postgres.go. It fired on every connect — admin DB plus per-database connections for grants and functions — so each resync cycle produced many lines per CustomRole.Notes
persistStatusnow takes the failing host and clears it on success.make generate manifests.Failedwon't getfailingHostpopulated until they next reconcile.Test plan
status.failingHostreports it andstatus.errormatches.status.failingHostclears on the next successful reconcile.Connecting to database.🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it updates the
CustomRoleCRD/status schema and refactors the widely-usedpostgres.ConnectAPI, which could affect controller behavior and diagnostics if any call sites were missed.Overview
Adds
status.failingHosttoCustomRoleand updates reconciliation to persist the host that triggered a failure (and clear it on success/invalid), including anIsUnchangedhelper to avoid no-op status updates.Removes the per-connection "Connecting to database" log by changing
postgres.Connectto no longer accept a logger, then updates all controller code and tests to use the new signature.Reviewed by Cursor Bugbot for commit 9d12464. Configure here.