Skip to content
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

Merged
merged 8 commits into from
Aug 24, 2022

Conversation

sfc-gh-jlove
Copy link
Contributor

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

  • acceptance tests

@github-actions
Copy link

Integration tests failure for be7d80a34796bea8e7fb688f40a205075cd0f7b1

@github-actions
Copy link

Integration tests failure for a7d1c1894bdf1542df8f77f9733287e69644d489

@github-actions
Copy link

Integration tests failure for fc62e8d11f1cb8eecfde26720060c76441a387ed

@github-actions
Copy link

Integration tests failure for 55051a8a80bc9f8c94a1f14930d95c8fb9c38149

@github-actions
Copy link

Integration tests success for d0cf9cba0cc4c7bc0d7400f14e66bb36d98a113d

@sfc-gh-jlove sfc-gh-jlove marked this pull request as ready for review August 24, 2022 18:15
@github-actions
Copy link

Integration tests success for 3574159b758f3af9f4afe992d9e4c7c9f7e28026

@@ -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 {
Copy link
Collaborator

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

Copy link
Collaborator

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")
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants