Merge pull request #1697 from terraform-providers/paddy_storace_acl_diff

Fix failing test for storage ACLs.
This commit is contained in:
Paddy 2018-06-25 13:16:20 -07:00 committed by GitHub
commit f0d6b4d4f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,13 @@ func resourceStorageBucketAclRead(d *schema.ResourceData, meta interface{}) erro
}
d.Set("role_entity", entities)
} else {
// if we don't set `role_entity` to nil (effectively setting it
// to empty in Terraform state), because it's computed now,
// Terraform will think it's missing from state, is supposed
// to be there, and throw up a diff for role_entity.#. So it
// must always be set in state.
d.Set("role_entity", nil)
}
return nil