terraform-provider-snowflake
terraform-provider-snowflake copied to clipboard
feat: Grant ownership follow up tasks [FOR LATER]
Add handling of the grant ownership on tasks.
func (v *grants) grantOwnershipOnAllTasks(ctx context.Context, opts *GrantOwnershipOptions) error {
// grant on all tasks
// 1. grant ownership on all tasks (Snowflake will suspend automatically)
// 2. go through tasks in [database|schema]
// 3. resume w if here last_suspended_reason was equal to "GRANT_OWNERSHIP" (have to resume parent first)
}
The second solution that almost enables us to provide automatic suspend/resume of tasks during grant ownership. This solution, instead of calling grant on all tasks
is calling show tasks
and going through every task one by one.
The current solution could be better if we could use grant on all tasks
and resume tasks that were suspended by grant ownership
call. This "may" be possible by utilizing last_suspend_reason_
field returned by SHOW TASKS
.
Integration tests failure for bbb917b105b7e49c162017b157621841e73eb1b6
Integration tests failure for eac42cc69d65b2178abd8e44d293fdeeeb102cb6
Integration tests failure for 1448561dee41f83dae334d7260b2cd931eb55be5
Integration tests failure for 3cf9e9c89ad668bc3d216468da192080de29ed7e
Integration tests failure for 85f09f56cdc4f476f50652b03180e451999a62fc