Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Scale: filter out the $tags tag #1770

Merged
merged 1 commit into from
Aug 15, 2018
Merged

Auto Scale: filter out the $tags tag #1770

merged 1 commit into from
Aug 15, 2018

Conversation

tombuildsstuff
Copy link
Contributor

Prior to this change (with the acctest fix contained in this PR):

$ acctests azurerm TestAccAzureRMAutoScaleSetting_basic
=== RUN   TestAccAzureRMAutoScaleSetting_basic
--- FAIL: TestAccAzureRMAutoScaleSetting_basic (400.30s)
	testing.go:513: Step 0 error: Check failed: Check 7/7 error: azurerm_autoscale_setting.test: Attribute 'tags.$type' found when not expected
FAIL
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm	400.721s

Now:

$ acctests azurerm TestAccAzureRMAutoScaleSetting_basic
=== RUN   TestAccAzureRMAutoScaleSetting_basic
--- PASS: TestAccAzureRMAutoScaleSetting_basic (399.98s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	400.321s

Fixes #1661

Prior to this change (with the acctest fix):

```
$ acctests azurerm TestAccAzureRMAutoScaleSetting_basic
=== RUN   TestAccAzureRMAutoScaleSetting_basic
--- FAIL: TestAccAzureRMAutoScaleSetting_basic (400.30s)
	testing.go:513: Step 0 error: Check failed: Check 7/7 error: azurerm_autoscale_setting.test: Attribute 'tags.$type' found when not expected
FAIL
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm	400.721s
```

Now:

```
$ acctests azurerm TestAccAzureRMAutoScaleSetting_basic
=== RUN   TestAccAzureRMAutoScaleSetting_basic
--- PASS: TestAccAzureRMAutoScaleSetting_basic (399.98s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	400.321s
```
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and 1 non-blocking 🤔

@@ -432,7 +432,9 @@ func resourceArmAutoScaleSettingRead(d *schema.ResourceData, meta interface{}) e
return fmt.Errorf("Error setting `notification` of Autoscale Setting %q (resource group %q): %+v", name, resourceGroup, err)
}

flattenAndSetTags(d, resp.Tags)
// Return a new tag map filtered by the specified tag names.
tagMap := filterTags(resp.Tags, "$type")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this filtering be applied more globally? There seems to have been a few issues related to it across various resources.

Copy link
Contributor Author

@tombuildsstuff tombuildsstuff Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily unfortunately - this values only restricted in certain API's (read: Monitor/App Insights) - such that it's potentially a valid key in other API's

@tombuildsstuff
Copy link
Contributor Author

Tests pass:

screenshot 2018-08-15 at 13 59 15

@tombuildsstuff tombuildsstuff merged commit 55bbf34 into master Aug 15, 2018
@tombuildsstuff tombuildsstuff deleted the autoscale-tags branch August 15, 2018 12:17
tombuildsstuff added a commit that referenced this pull request Aug 15, 2018
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

azurerm_autoscale_settings: tag "$type" is treated as changed on plan
2 participants