-
Notifications
You must be signed in to change notification settings - Fork 418
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: Fix snowflake_share resource not unsetting accounts #1186
Conversation
Integration tests failure for be7d80a34796bea8e7fb688f40a205075cd0f7b1 |
Integration tests failure for a7d1c1894bdf1542df8f77f9733287e69644d489 |
Integration tests failure for fc62e8d11f1cb8eecfde26720060c76441a387ed |
Integration tests failure for 55051a8a80bc9f8c94a1f14930d95c8fb9c38149 |
Integration tests success for d0cf9cba0cc4c7bc0d7400f14e66bb36d98a113d |
Integration tests success for 3574159b758f3af9f4afe992d9e4c7c9f7e28026 |
pkg/resources/share.go
Outdated
@@ -90,7 +90,7 @@ func setAccounts(d *schema.ResourceData, meta interface{}) error { | |||
name := d.Get("name").(string) | |||
accs := expandStringList(d.Get("accounts").([]interface{})) | |||
|
|||
if len(accs) > 0 { | |||
if len(accs) >= 0 { |
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.
i'm pretty sure this does nothing since the default value is an empty list
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.
can you please remove this unnecessary check?
@@ -15,6 +16,8 @@ const ( | |||
|
|||
func TestAcc_Share(t *testing.T) { | |||
name := strings.ToUpper(acctest.RandStringFromCharSet(10, acctest.CharSetAlpha)) | |||
account2 := os.Getenv("account2") |
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.
if you pass in any account will it work? for example a random string?
Going from a list of accounts to an empty list on the share resource would not remove the accounts from the share. This was a bug. This fix fixes that bug.
Test Plan