Skip to content

Commit

Permalink
Unbreak IAM. (#2180)
Browse files Browse the repository at this point in the history
Merged PR #2180.
  • Loading branch information
paddycarver authored and modular-magician committed Aug 14, 2019
1 parent ad8a5af commit bba002a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
12 changes: 11 additions & 1 deletion third_party/terraform/utils/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 bba002a

Please sign in to comment.