Explain this silliness.

Add a comment explaining why I'm setting something to nil in state.
This commit is contained in:
Paddy Carver 2018-06-25 13:12:28 -07:00
parent d7078ab309
commit 87be5d2345

View File

@ -212,6 +212,11 @@ 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)
}