Skip to content

Commit

Permalink
provider/azurerm: fix computed tags causing non-empty plan
Browse files Browse the repository at this point in the history
The tag schema was changed in hashicorp#9199, setting the Computed flag, this was causing
the plan to not be empty for resources which support tags but none were set, as
no value would be set by flattenAndSetTags.

Setting an empty map instead fixes the issue, ran original failing test and an
update tags test to ensure nothing else was broken.

```
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMCdnProfile_basic -timeout 120m
=== RUN   TestAccAzureRMCdnProfile_basic
--- PASS: TestAccAzureRMCdnProfile_basic (208.11s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	208.188s
```
  • Loading branch information
Peter McAtominey committed Oct 10, 2016
1 parent 70a90cc commit b13b6a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin/providers/azurerm/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func expandTags(tagsMap map[string]interface{}) *map[string]*string {

func flattenAndSetTags(d *schema.ResourceData, tagsMap *map[string]*string) {
if tagsMap == nil {
d.Set("tags", make(map[string]interface{}))
return
}

Expand Down

0 comments on commit b13b6a5

Please sign in to comment.