Skip to content

Commit

Permalink
Fix the regression of handling deleted IAM members in google_bigquery…
Browse files Browse the repository at this point in the history
…_dataset_iam* (#11898) (#2934)

[upstream:0b8a8585660d86b3ee6494caa91dfa737f3ff507]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Oct 15, 2024
1 parent aa43152 commit 784357a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/hcl/v2 v2.20.1
github.com/hashicorp/terraform-json v0.22.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015130745-f1716db1aa43
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015135325-981e496a6c3a
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh
github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A=
github.com/hashicorp/terraform-plugin-testing v1.5.1 h1:T4aQh9JAhmWo4+t1A7x+rnxAJHCDIYW9kXyo4sVO92c=
github.com/hashicorp/terraform-plugin-testing v1.5.1/go.mod h1:dg8clO6K59rZ8w9EshBmDp1CxTIPu3yA4iaDpX1h5u0=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015130745-f1716db1aa43 h1:tfBsJ5zqtUMwchCszfSRzqM1Zrn3nmqnzP7Oo2Jq7H0=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015130745-f1716db1aa43/go.mod h1:0LymWybO9dJ38EJdzzbUKO9LaYBgoJsR/gKVAP+8hr8=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015135325-981e496a6c3a h1:1LCM5m0H6f+11phQ4o0VcXDus7+NXmxvBeysg5rdmVk=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20241015135325-981e496a6c3a/go.mod h1:0LymWybO9dJ38EJdzzbUKO9LaYBgoJsR/gKVAP+8hr8=
github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI=
github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM=
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func policyToAccess(policy *cloudresourcemanager.Policy) ([]map[string]interface
}
for _, member := range binding.Members {
// Do not append any deleted members
if strings.HasPrefix(member, "deleted:") {
if strings.HasPrefix(member, "iamMember:deleted:") {
continue
}
access := map[string]interface{}{
Expand All @@ -211,7 +211,7 @@ func policyToAccess(policy *cloudresourcemanager.Policy) ([]map[string]interface
// Dataset access uses different member types to identify groups, domains, etc.
// these types are used as keys in the access JSON payload
func iamMemberToAccess(member string) (string, string, error) {
if strings.HasPrefix(member, "deleted:") {
if strings.HasPrefix(member, "iamMember:deleted:") {
return "", "", fmt.Errorf("BigQuery Dataset IAM member is deleted: %s", member)
}
pieces := strings.SplitN(member, ":", 2)
Expand Down

0 comments on commit 784357a

Please sign in to comment.