Repository navigation
Log the result of a Grant and DefaultPrivilege reconcile, and name the failed resource in all reconcile error logs - #96
Merged
Conversation
A Grant in ALL mode on tables or sequences runs its bulk grant on each reconcile, so it always logs "Updated Grant", never "Grant up-to-date". Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
Grant and DefaultPrivilege reconcile
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
The other reconcilers log in the present tense, and the transaction commits only after the log line. Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
handleError already logs the exception with the kind, the namespace and the name of the resource. Assisted-by: Claude:claude-opus-5-5
…ssage Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
Assisted-by: Claude:claude-opus-5-5
Grant and DefaultPrivilege reconcileGrant and DefaultPrivilege reconcile, and name the failed resource in all reconcile error logs
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 #95
GrantReconcilerandDefaultPrivilegeReconcilerchanged the phase without a log entry. The log showed onlyReconciling Grant [...], so the operator log alone could not tell if aGrantor aDefaultPrivilegewasREADYorERROR.What changed
ERRORwithout an exception is logged. The newBaseReconciler.setErrorPhasesetsERRORand the message, and logs aWARNwith the same message:Failed to reconcile <kind> [resource=<namespace>/<name>, message=...]. The kind tells aGrantfrom aDefaultPrivilegewith the same name, because the logger isBaseReconcilerfor both. The fiveERRORbranches in the two reconcilers use it.Grant up-to-dateorUpdating Grant, andDefaultPrivilege up-to-dateorUpdating DefaultPrivilege, in the present tense like the other reconcilers. "Updating" means that at least oneGRANTorREVOKEstatement changes a privilege. The transaction commits after the log line. For this,GrantService.grantOnAllnow returnstruewhen it runs its statement. In "ALL" mode, the bulk grant counts as an update only if a non-owned object misses an expected privilege.cleanupmethods passetolog.error, the same asRoleReconcilerandDatabaseReconciler.resource=now shows the namespace and the name of theGrantorDefaultPrivilege, not of theclusterRef. The two tests for this message now also check theresource=value.BaseReconciler.handleErrornow logsFailed to reconcile <kind> [resource=<namespace>/<name>], not only the name. This changes the exception log of all reconcilers.ClusterConnectioncheck is logged once.ClusterConnectionReconcilerlogged the exception itself and then again inhandleError. It now only useshandleError.•bullet only between the objects, so the first object had none. The new testserrorWhenTableDoesNotExistandreadyWhenRoleOwnsTablecheck both messages, with the bullet and theresource=value.Checks that CI cannot do
WARN,Updating …and… up-to-datelines, and theWARNlines name the reconciled resource.