-
Notifications
You must be signed in to change notification settings - Fork 229
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
Change user lists to sets #116
Conversation
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.
Thanks, @medains. I agree with this change, but it breaks some acceptances tests because we can't read elements from sets as the tests are trying to do. Could you please update them? Removing the following should do it:
terraform-provider-grafana/grafana/resource_organization_test.go
Lines 65 to 67 in 71990e2
resource.TestCheckResourceAttr( "grafana_organization.test", "admins.0", "john.doe@example.com", ), terraform-provider-grafana/grafana/resource_organization_test.go
Lines 89 to 91 in 71990e2
resource.TestCheckResourceAttr( "grafana_organization.test", "editors.0", "john.doe@example.com", ), terraform-provider-grafana/grafana/resource_organization_test.go
Lines 140 to 142 in 71990e2
resource.TestCheckResourceAttr( "grafana_organization.test", "admins.0", "john.doe@example.com", ), terraform-provider-grafana/grafana/resource_organization_test.go
Lines 164 to 169 in 71990e2
resource.TestCheckResourceAttr( "grafana_organization.test", "admins.0", "admin@localhost", ), resource.TestCheckResourceAttr( "grafana_organization.test", "admins.1", "john.doe@example.com", ),
Also please remove the following from the organization resource docs:
Note - Users specified for each role-group (admins, editors, viewers) should be listed in ascending alphabetical order (A-Z). By defining users in alphabetical order, Terraform is prevented from detecting unnecessary changes when comparing the list of defined users in the resource to the (ordered) list returned by the Grafana API.
Updated as requested |
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.
Awesome. Thanks, @medains 👍
Users as lists may not be reported back from grafana in the same order - resulting in continually reported resource changes.
Treating the users as sets instead deals with this nicely.