-
Notifications
You must be signed in to change notification settings - Fork 319
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
Update project shared_with_groups
option: change type to TypeSet
#86
Update project shared_with_groups
option: change type to TypeSet
#86
Conversation
Acceptance tests results:
|
@jorcau how does it behave on existing states? No weird behavior? |
b8a5d84
to
e5c8d95
Compare
gitlab/resource_gitlab_project.go
Outdated
if v, ok := d.GetOk("shared_with_groups"); ok { | ||
options := expandSharedWithGroupsOptions(v.([]interface{})) | ||
if _, ok := d.GetOk("shared_with_groups"); ok { | ||
options := expandSharedWithGroupsOptions(d) |
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 did not mean to pass d
but v
😕
gitlab/resource_gitlab_project.go
Outdated
@@ -298,10 +298,11 @@ func resourceGitlabProjectDelete(d *schema.ResourceData, meta interface{}) error | |||
return nil | |||
} | |||
|
|||
func expandSharedWithGroupsOptions(d []interface{}) []*gitlab.ShareWithGroupOptions { | |||
func expandSharedWithGroupsOptions(d *schema.ResourceData) []*gitlab.ShareWithGroupOptions { | |||
v := d.Get("shared_with_groups").(*schema.Set).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.
The d.Get("shared_with_groups")
part should have stayed outside.
e5c8d95
to
1a159c2
Compare
Hi,
This is a small fix for the shared_with_groups option in the project resource.
This makes
shared_with_groups
a TypeSet instead of TypeList in order to discard group list order and improve the plan.