-
Notifications
You must be signed in to change notification settings - Fork 427
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
feat: Added Missing Grant Updates + Removed ForceNew #1228
feat: Added Missing Grant Updates + Removed ForceNew #1228
Conversation
@sfc-gh-swinkler Can this be reviewed and then released (it's quite blocking for us)? |
Can someone take a look at this? @sfc-gh-jlove @sfc-gh-swinkler? |
func UpdateExternalTableGrant(d *schema.ResourceData, meta interface{}) error { | ||
// for now the only thing we can update are roles or shares | ||
// if nothing changed, nothing to update and we're done | ||
if !d.HasChanges("roles", "shares") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since everything else is marked as forcenew, this code will actually never run. but at least it makes it clear what future work needs to be done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfc-gh-swinkler The ForceNew should be removed that's why the Update was implemented
/ok-to-test sha=h555490c |
Integration tests failure for h555490c |
@ChrisIsidora this looks good, but you missed one of the updates functions to the snowflake_row_access_policy_grant schema. |
@sfc-gh-swinkler I added the missing Update Function for snowflake_row_access_policy_grant. Can you run the tests again? |
/ok-to-test sha=7807218 |
thank you for your contribution! |
Integration tests failure for 7807218 |
Added missing update function on resource grants and removed ForceNew from Shares + Roles. This is added to mitigate the current side effects of ForceNew when you add a Share or Role to an existing Grant. Currently existings grants are revoked and then recreated when you add a share or role to a existing grant that has no implementation of the update function and has ForceNew set to true. This causes current queries / users sessions that uses the existing grants to fail because the existing grants where revoked to be recreated a couple of seconds later. This feature makes it possible to only apply the difference.
This has already been done for a couple of resource grants and works properly.
Test Plan