mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Fix failing test for storage ACLs.
When using predefined storage ACLs, you'd get a permadiff, because the role_entities list was computed, but was never set in state. So it would be read as empty in the config, and not present in state, so Terraform would want to pull it down and sync it. This is probably, technically speaking, a bug in Terraform, but we can work around it by just setting role_entities to an empty value on every read.
This commit is contained in:
parent
101b15fb80
commit
d7078ab309
@ -130,6 +130,7 @@ func resourceStorageBucketAclCreate(d *schema.ResourceData, meta interface{}) er
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(role_entity) > 0 {
|
||||
current, err := config.clientStorage.BucketAccessControls.List(bucket).Do()
|
||||
if err != nil {
|
||||
@ -210,6 +211,8 @@ func resourceStorageBucketAclRead(d *schema.ResourceData, meta interface{}) erro
|
||||
}
|
||||
|
||||
d.Set("role_entity", entities)
|
||||
} else {
|
||||
d.Set("role_entity", nil)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user