Skip to content
This repository has been archived by the owner on Jun 27, 2021. It is now read-only.

Remove a block which failed with the wrong error #164

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

psalaberria002
Copy link
Contributor

@psalaberria002 psalaberria002 commented Jan 8, 2021

We had a case where the API had some users with the MEMBER role, but the Terraform config was trying to set the OWNER role to them.

We got Error: [ERROR] Error updating memberships: [ERROR] Error updating groupMember ([email protected]): nested groups should be role MEMBER which made no sense.

Is there any reason for that condition to be in the reconcile function?

We had a case where the API had some users with the MEMBER role, but the Terraform config was trying to set the OWNER role to them.

We got `Error: [ERROR] Error updating memberships: [ERROR] Error updating groupMember ([email protected]): nested groups should be role MEMBER` which made no sense.
@DeviaVir
Copy link
Owner

Yes, this condition prevents users trying to add nested groups as role OWNER (which is not allowed by the admin API)

@psalaberria002
Copy link
Contributor Author

That happens in a different block in the same file. This block is hit even when the member is not a group. I suspect is coming from an old copy paste.

@psalaberria002
Copy link
Contributor Author

@DeviaVir can you have another look?

@DeviaVir
Copy link
Owner

DeviaVir commented Feb 5, 2021

I see:

if isGroup == true {
if role != "MEMBER" {
return fmt.Errorf("[ERROR] Error creating groupMember (%s): nested groups should be role MEMBER", email)
}

Ack.

@DeviaVir DeviaVir merged commit 3bacac6 into DeviaVir:master Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants