Repository navigation
Keep the current owner of a Database or Schema without owner in the spec - #93
Merged
Merged
Conversation
…e spec Before, the reconcile compared the current owner with null and ran "alter ... owner to """, which PostgreSQL rejects. Assisted-by: Claude:claude-opus-5-5
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 #90
A
DatabaseorSchemawithoutspec.ownerwent toERRORon each reconcile after the first one:The reconcile compared the current owner, for example the admin user, with
null.Objects.equalsis null-safe, but it returnstrueonly when both values arenull. The current owner is nevernull, so the reconciler always ranalter … owner towithrole(null), which renders as"". This happened at each spec change, at each resync and at each restart of the operator.What changed
ownerin the spec means "keep the current owner".DatabaseReconcilerandSchemaReconcilertreat the owner as up to date whenspec.ownerisnull. This agrees with the create path, which also skips the owner when it isnull.ownerfield inDatabaseSpec,SchemaSpec,docs/database.mdanddocs/schema.mdnow says that the resource keeps its current owner whenowneris not set or is removed.Databaseand aSchemawithout an owner a second time, and expectREADYand the same owner as before. TheDatabaseandSchematests from Set the status toREADYwhen aDatabase,SchemaorRoleis already up to date #91 no longer set an explicit owner to avoid this bug.Consequences
owneris removed from a resource, the operator does not change the owner back to the admin user. To change the owner, setownerto the new role.Checks that CI cannot do
DatabaseandSchematests from Set the status toREADYwhen aDatabase,SchemaorRoleis already up to date #91 fail.