From bba002a9c572ecceba603c513ff99335546c6f04 Mon Sep 17 00:00:00 2001 From: Paddy Date: Wed, 14 Aug 2019 16:00:21 -0700 Subject: [PATCH] Unbreak IAM. (#2180) Merged PR #2180. --- build/terraform | 2 +- build/terraform-beta | 2 +- third_party/terraform/utils/iam.go | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/terraform b/build/terraform index cb38377d626e..57bde0d656ca 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit cb38377d626eaad88f46cce4a136ce1f3e2c6aa0 +Subproject commit 57bde0d656caf932c96e4b9821bf440bfccf9ce4 diff --git a/build/terraform-beta b/build/terraform-beta index 6d5a77af6fb3..b412e94e2000 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit 6d5a77af6fb3fba07a95529072e4375c426043e8 +Subproject commit b412e94e2000b1e22929fb877ec5dc9537ce6fd6 diff --git a/third_party/terraform/utils/iam.go b/third_party/terraform/utils/iam.go index 5a87228a30ab..d310b7f88bf7 100644 --- a/third_party/terraform/utils/iam.go +++ b/third_party/terraform/utils/iam.go @@ -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 : format + // is case sensitive + // 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