DeviaVir / terraform-provider-gsuite

A @HashiCorp Terraform provider for managing G Suite resources.
MIT License
271 stars 77 forks source link

Can't update group members that don't have the MEMBER role #179

Open ricardograca-scratch opened 3 years ago

ricardograca-scratch commented 3 years ago

Version: 0.1.58

I'm trying to update the role of a group member from MEMBER to OWNER, but the deployment process fails with error:

[ERROR] Error updating memberships: [ERROR] Error updating groupMember (<--redacted-->): nested groups should be role MEMBER

After looking at the code in gsuite/resource_group_members.go#L280 it seems that the role is hard-coded as MEMBER. Shouldn't this check for any type of valid group role?

I can see that in reality the role hasn't been changed yet, so this error is a bit puzzling.

DeviaVir commented 3 years ago

A group cannot be owner of another group.

ricardograca-scratch commented 3 years ago

No such thing is going on here. The affected email account belongs to a user not a group, which is even stranger.

ricardograca-scratch commented 3 years ago

@DeviaVir Have you had a chance to look into this? I can provide an example code to reproduce this issue in case it helps.

DeviaVir commented 3 years ago

Oh yes, that would help.