Repository navigation
Set the status to READY when a Database, Schema or Role is already up to date - #91
Merged
Merged
Conversation
Without a status patch, a PENDING or ERROR phase stayed after its cause went away, because the reconcile found nothing to change. Assisted-by: Claude:claude-opus-5-5
…ilege Assisted-by: Claude:claude-opus-5-5
ThoSap
force-pushed
the
fix-status-stays-pending-when-up-to-date
branch
from
October 25, 2026 14:33
fe662b0 to
9400f48
Compare
This was referenced Oct 25, 2026
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.
Fixes #89
DatabaseReconciler,SchemaReconcilerandRoleReconcilerreturnedUpdateControl.noUpdate()when the PostgreSQL object already matched the spec. The reconcile did not write the status, so aPENDINGorERRORphase stayed after its cause went away. On a test cluster, 21 resources showedPENDINGfor 40 days after a short outage of theirClusterConnection, although each reconcile logged "up-to-date".What changed
READY, clears the message and returnsUpdateControl.patchStatus(resource), asGrantReconciler,DefaultPrivilegeReconcilerandClusterConnectionReconcileralready do, and as the Garage Operator does.lastProbeTimeandobservedGenerationare written on each reconcile. Before,noUpdate()also dropped them. After a spec change that needed no SQL statement,observedGenerationstayed at the old generation.Database,Schema,Role,GrantandDefaultPrivilegepointclusterRefto a missingClusterConnection, so the operator setsPENDING, and then point it back.ClusterConnectionchanges itsportto a closed port, so the operator setsERROR, and then restores it. Each test expectsREADYat the end.Consequences
generation-aware: truefilters the status events, so the write does not start a new reconcile.Checks that CI cannot do
Database,SchemaandRoletests fail. Each one times out whenclusterRefpoints back, becauseobservedGenerationis never written. The newGrant,DefaultPrivilegeandClusterConnectiontests guard behavior that was already correct.Related
DatabaseorSchemawithoutownergoes toERRORon its second reconcile. The newDatabaseandSchematests set an explicit owner to avoid this bug. This PR does not fix it.Other changes
varwhere the same type is inferred, and formatting of a few test files. These changes do not change the behavior.