fix: fixes for database role grants #193
Open
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.
fetch_database_role_grant
function to mimic the behavior offetch_role_grant
in the data provider_resources_from_database_role_grants_config
function in gitops to account for database role grants to other database rolesHey @teej I have one more for you. Was running into some trouble with database role grants and I think this is the culprit. To be quite honest, I didn't spend much time reading into this. I popped the code from the
fetch_role_grant
function into this one and just updated the code where needed to reflect the difference for database roles, and it worked for my use case.In case you're interested in reproducing the problem I had:
If you perform the above grants by hand, then run Titan, it will attempt to update the grant for
example_role_2
fromexample_role_1
toexample_role_2
.While testing the above behavior with grants to database roles, I stumbled across another error, which is that if your config is exclusively database role grants to other database roles, they are not correctly parsed. The change I made in the
gitops.py
file addresses that issue.