Skip to content

Commit

Permalink
Unbreak IAM. (#1047)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and paddycarver committed Aug 14, 2019
1 parent 6d5a77a commit b412e94
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion google-beta/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,18 @@ func createIamBindingsMap(bindings []*cloudresourcemanager.Binding) map[string]m
}
// Get each member (user/principal) for the binding
for _, m := range b.Members {
// members are in <type>:<value> format
// <type> is case sensitive
// <value> isn't
// so let's lowercase the value and leave the type alone
pieces := strings.SplitN(m, ":", 2)
if len(pieces) > 1 {
pieces[1] = strings.ToLower(pieces[1])
}
m = strings.Join(pieces, ":")

// Add the member
bm[b.Role][strings.ToLower(m)] = struct{}{}
bm[b.Role][m] = struct{}{}
}
}
return bm
Expand Down

0 comments on commit b412e94

Please sign in to comment.