fix based on
@@ -300,11 +300,12 @@ func unpackGroups(d *schema.ResourceData, client *resty.Client, tokenOptions *Ac
for i, group := range srcGroups.([]interface{}) {
groups[i] = group.(string)
- exist, err := checkGroupExists(client, groups[i])
- if !exist && groups[i] != "*" {
+ if groups[i] != "*" {
+ if exist, err := checkGroupExists(client, groups[i]); !exist {
return err
}
}
+ }
scopedGroupString := strings.Join(groups[:], ",")
scope := "member-of-groups:\"" + scopedGroupString + "\""
