-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: with_grant_option diff drift #2608
Conversation
Integration tests success for ec831cd559ecc7343ca6fccb261eda704e2d6e34 |
ea19b61
to
4a80c90
Compare
Integration tests failure for ea19b61e5dc85815508093aec7b88c83332891e9 |
Integration tests failure for 4a80c90aa42f732b66a112dd6424f455f0dfe563 |
4a80c90
to
363136a
Compare
Integration tests failure for 363136a2ad2ce7155e70b035b33ef5cba2116095 |
# Conflicts: # pkg/resources/grant_privileges_to_account_role_acceptance_test.go # pkg/resources/grant_privileges_to_database_role_acceptance_test.go
Integration tests failure for e26a4f9ff207a02064b4b538c9c6e5555f4eaf51 |
Integration tests failure for 7dff96c2a42fb9e8aa4426381c69c01fee4fe819 |
Integration tests failure for 3fc15c3176df920989b3f6f876aff899f92be2c8 |
🤖 I have created a release *beep* *boop* --- ## [0.88.0](v0.87.3-pre...v0.88.0) (2024-04-09) ### 🎉 **What's new:** * Fix issues 2651 2656 ([#2659](#2659)) ([7fa09cc](7fa09cc)) * Grant ownership follow up ([#2628](#2628)) ([d467e5b](d467e5b)) * grant ownership follow-up ([#2658](#2658)) ([bfa2317](bfa2317)) * grant ownership on tasks ([#2684](#2684)) ([2ba7889](2ba7889)) * Introduce shared function to suspend task roots ([#2650](#2650)) ([d684b5d](d684b5d)) * Redesign snowflake_grants datasource ([#2667](#2667)) ([918873d](918873d)) * user password policy attachment ([#2627](#2627)) ([382e49d](382e49d)) ### 🔧 **Misc** * release 0.88.0 ([02d60e0](02d60e0)) * Update grant examples in all resources ([#2660](#2660)) ([b542b69](b542b69)) ### 🐛 **Bug fixes:** * Adjust dynamic tables after BCR-1543 ([#2664](#2664)) ([cf32ceb](cf32ceb)) * Fix handling secure views read and import ([#2655](#2655)) ([3c3ede6](3c3ede6)) * Fix issues 2606 2642 2652 2653 ([#2654](#2654)) ([4a73721](4a73721)) * Fix release workflow ([#2639](#2639)) ([dfd07e9](dfd07e9)) * Generate docs for dynamic table ([#2666](#2666)) ([16c75b0](16c75b0)) * grant read operation ([#2665](#2665)) ([0b947a5](0b947a5)) * migration guide for databases created from share ([#2637](#2637)) ([f9651bc](f9651bc)) * with_grant_option diff drift ([#2608](#2608)) ([f0018c6](f0018c6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
Fixes: #2459
The issue was related to the fact that the Read operation is only concerned about privileges (with_grant_option is also taken into consideration, but it's never set). Given this configuration:
after apply we run the following commands by hand
Now, when we run
plan
orapply
our resource is seeing a drift (the "TRUNCATE" privilege is not present, becausewith_grant_option
is not matching) and tries to run the Update operation (unsuccessfully; 1. because of the "sdk.GrantPrivOptions" not set 2. because of the incorrect logic). When there're already existing grants there are two ways to updatewith_grant_option
which depends on what is set in Snowflake. It's better to show it with SQLs, so:The fix I opted to is to:
todo other grant privileges to database role
Test Plan