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

provider/azurerm: Locking around Network Security Group / Subnets #13637

Merged
merged 5 commits into from
Apr 18, 2017

Conversation

tombuildsstuff
Copy link
Contributor

Currently there's a bug regarding Network Security Groups, where trying to create a Subnet / Virtual Network / Network Security Rule (as in this example / #7986) would fail.

This PR fixes that, by only allowing a single modification to NSG's at once.

$ envchain azurerm make testacc TEST=./builtin/providers/azurerm/ TESTARGS='-run=TestAccAzureRMVirtualNetwork_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/13 16:34:19 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm/ -v -run=TestAccAzureRMVirtualNetwork_ -timeout 120m
=== RUN   TestAccAzureRMVirtualNetwork_importBasic
--- PASS: TestAccAzureRMVirtualNetwork_importBasic (88.11s)
=== RUN   TestAccAzureRMVirtualNetwork_basic
--- PASS: TestAccAzureRMVirtualNetwork_basic (97.94s)
=== RUN   TestAccAzureRMVirtualNetwork_disappears
--- PASS: TestAccAzureRMVirtualNetwork_disappears (99.59s)
=== RUN   TestAccAzureRMVirtualNetwork_withTags
--- PASS: TestAccAzureRMVirtualNetwork_withTags (124.40s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	410.070s
$ envchain azurerm make testacc TEST=./builtin/providers/azurerm/ TESTARGS='-run=TestAccAzureRMSubnet'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/13 16:43:09 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm/ -v -run=TestAccAzureRMSubnet -timeout 120m
=== RUN   TestAccAzureRMSubnet_importBasic
--- PASS: TestAccAzureRMSubnet_importBasic (134.67s)
=== RUN   TestAccAzureRMSubnet_basic
--- PASS: TestAccAzureRMSubnet_basic (115.68s)
=== RUN   TestAccAzureRMSubnet_disappears
--- PASS: TestAccAzureRMSubnet_disappears (116.02s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	366.400s
$ envchain azurerm make testacc TEST=./builtin/providers/azurerm/ TESTARGS='-run=TestAccAzureRMNetworkSec'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/13 16:52:35 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm/ -v -run=TestAccAzureRMNetworkSec -timeout 120m
=== RUN   TestAccAzureRMNetworkSecurityGroup_importBasic
--- PASS: TestAccAzureRMNetworkSecurityGroup_importBasic (130.12s)
=== RUN   TestAccAzureRMNetworkSecurityRule_importBasic
--- PASS: TestAccAzureRMNetworkSecurityRule_importBasic (152.71s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_basic
--- PASS: TestAccAzureRMNetworkSecurityGroup_basic (99.37s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_disappears
--- PASS: TestAccAzureRMNetworkSecurityGroup_disappears (96.89s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_withTags
--- PASS: TestAccAzureRMNetworkSecurityGroup_withTags (109.85s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_addingExtraRules
--- PASS: TestAccAzureRMNetworkSecurityGroup_addingExtraRules (128.04s)
=== RUN   TestAccAzureRMNetworkSecurityRule_basic
--- PASS: TestAccAzureRMNetworkSecurityRule_basic (141.60s)
=== RUN   TestAccAzureRMNetworkSecurityRule_disappears
--- PASS: TestAccAzureRMNetworkSecurityRule_disappears (144.02s)
=== RUN   TestAccAzureRMNetworkSecurityRule_addingRules
--- PASS: TestAccAzureRMNetworkSecurityRule_addingRules (207.60s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/azurerm	1210.223s

Fixes #7986

Copy link
Contributor

@grubernaut grubernaut left a comment

Choose a reason for hiding this comment

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

LGTM, minor nit

if v, ok := d.GetOk("subnet"); ok {
subnets := v.(*schema.Set).List()
for _, subnet := range subnets {
subnet := subnet.(map[string]interface{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we catch any errors from the interface cast here, and return?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done :)

@tombuildsstuff
Copy link
Contributor Author

Tests still pass - agreed to merge this with @grubernaut 👍

@ghost
Copy link

ghost commented Apr 13, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 13, 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.

Status=429 Code="RetryableError" Message="A retryable error occured."
2 participants