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: added local network gateway resource #4342

Merged
merged 2 commits into from
Dec 31, 2015

Conversation

aznashwan
Copy link
Contributor

No description provided.

@jen20
Copy link
Contributor

jen20 commented Dec 16, 2015

Hi @aznashwan! This looks good - much easier to add resources now the base work is in!

In order to keep Terraform in a state where it can be released, could you consider adding acceptance tests (in this style) and resource documentation (like this)?

@@ -13,13 +13,18 @@
<li<%= sidebar_current(/^docs-azurerm-resource/) %>>
<a href="#">Resources</a>
<ul class="nav nav-visible">
<li<%= sidebar_current("docs-azure-resource-resource-group") %>>
<li<%= sidebar_current("docs-azurerm-resource-resource-group") %>>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jen20 @phinze: not entirely sure how vital this change here is...

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 good catch!

@jen20
Copy link
Contributor

jen20 commented Dec 17, 2015

Hi @aznashwan! Thanks for adding and fixing up the tests. However, running the new local network gateway acceptance tests causes a panic:

$ make testacc TEST=./builtin/providers/azurerm
go generate ./...
TF_ACC=1 go test ./builtin/providers/azurerm -v  -timeout 90m
=== RUN TestProvider
--- PASS: TestProvider (0.00s)
=== RUN TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN TestAccAzureRMLocalNetworkGateway_basic
panic: interface conversion: interface is nil, not []interface {}

goroutine 90 [running]:
github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmLocalNetworkGatewayCreate(0xc20830b500, 0x5b5f40, 0xc20809c000, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_local_network_gateway.go:81 +0x3c8
github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc20802d6c0, 0xc2080f76b0, 0xc20824b260, 0x5b5f40, 0xc20809c000, 0xf9d01, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/helper/schema/resource.go:145 +0x2c1
github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc20800b620, 0xc20813cc80, 0xc2080f76b0, 0xc20824b260, 0x1, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/helper/schema/provider.go:162 +0x1da
github.com/hashicorp/terraform/terraform.(*EvalApply).Eval(0xc20813ce40, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval_apply.go:67 +0x62a
github.com/hashicorp/terraform/terraform.EvalRaw(0xf142b8, 0xc20813ce40, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x254
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc208254ec0, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval_sequence.go:10 +0xf9
github.com/hashicorp/terraform/terraform.EvalRaw(0xf13c20, 0xc208254ec0, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x254
github.com/hashicorp/terraform/terraform.(*EvalOpFilter).Eval(0xc208253ad0, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval_filter_operation.go:37 +0x71
github.com/hashicorp/terraform/terraform.EvalRaw(0xf13c48, 0xc208253ad0, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x254
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc208263260, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval_sequence.go:10 +0xf9
github.com/hashicorp/terraform/terraform.EvalRaw(0xf13c20, 0xc208263260, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x254
github.com/hashicorp/terraform/terraform.Eval(0xf13c20, 0xc208263260, 0xf13a58, 0xc2080d9450, 0x0, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:34 +0x79
github.com/hashicorp/terraform/terraform.func·027(0x7ee280, 0xc2082520f0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/graph.go:198 +0x906
github.com/hashicorp/terraform/dag.func·006(0x7ee280, 0xc2082520f0, 0xc20810fda0, 0xc20810fe00)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:238 +0x106
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:247 +0x877

goroutine 1 [chan receive]:
testing.RunTests(0x9e2bf0, 0xc72060, 0x6, 0x6, 0xc76a01)
    /usr/local/Cellar/go14/1.4.2/libexec/src/testing/testing.go:556 +0xad6
testing.(*M).Run(0xc208030460, 0xc7de20)
    /usr/local/Cellar/go14/1.4.2/libexec/src/testing/testing.go:485 +0x6c
main.main()
    github.com/hashicorp/terraform/builtin/providers/azurerm/_test/_testmain.go:62 +0x1d5

goroutine 8 [chan receive]:
github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk(0xc2080fc9c0, 0xc208106c60, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:250 +0x8c4
github.com/hashicorp/terraform/terraform.(*Graph).walk(0xc2080fc9c0, 0xf139c0, 0xc20806fa40, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/graph.go:237 +0x2c3
github.com/hashicorp/terraform/terraform.(*Graph).Walk(0xc2080fc9c0, 0xf139c0, 0xc20806fa40, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/graph.go:152 +0x4e
github.com/hashicorp/terraform/terraform.(*Context).walk(0xc2080a9790, 0xc2080fc9c0, 0xc2080fc902, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/context.go:518 +0x1ca
github.com/hashicorp/terraform/terraform.(*Context).Apply(0xc2080a9790, 0x0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/context.go:298 +0x1a3
github.com/hashicorp/terraform/helper/resource.testStep(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc20809a270, 0x0, ...)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/helper/resource/testing.go:256 +0xf49
github.com/hashicorp/terraform/helper/resource.Test(0xf126f8, 0xc20805a120, 0xc2080ac9e0, 0xc20800b770, 0x0, 0x9e29a8, 0xc20809a240, 0x1, 0x1)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/helper/resource/testing.go:141 +0x947
github.com/hashicorp/terraform/builtin/providers/azurerm.TestAccAzureRMLocalNetworkGateway_basic(0xc20805a120)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_local_network_gateway_test.go:29 +0x38b
testing.tRunner(0xc20805a120, 0xc72090)
    /usr/local/Cellar/go14/1.4.2/libexec/src/testing/testing.go:447 +0xbf
created by testing.RunTests
    /usr/local/Cellar/go14/1.4.2/libexec/src/testing/testing.go:555 +0xa8b

goroutine 54 [semacquire]:
sync.(*WaitGroup).Wait(0xc208106c80)
    /usr/local/Cellar/go14/1.4.2/libexec/src/sync/waitgroup.go:132 +0x169
github.com/hashicorp/terraform/dag.func·004()
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:173 +0x52
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:174 +0x1b7

goroutine 57 [select]:
github.com/hashicorp/terraform/dag.func·005(0x7b2340, 0xc2080accf0, 0xc2080ad920, 0x1, 0x1, 0xc20802e408, 0x1, 0x1, 0xc2080fcfc0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:205 +0x708
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:229 +0x730

goroutine 58 [chan receive]:
github.com/hashicorp/terraform/dag.func·006(0x7b2340, 0xc2080accf0, 0xc2080fce40, 0xc2080fcfc0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:237 +0xd6
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:247 +0x877

goroutine 62 [chan receive]:
github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk(0xc20810fc20, 0xc2082631a0, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:250 +0x8c4
github.com/hashicorp/terraform/terraform.(*Graph).walk(0xc20810fc20, 0xf139c0, 0xc20806fa40, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/graph.go:237 +0x2c3
github.com/hashicorp/terraform/terraform.func·027(0x8013e0, 0xc2080b2300, 0x0, 0x0)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/terraform/graph.go:217 +0xc22
github.com/hashicorp/terraform/dag.func·006(0x8013e0, 0xc2080b2300, 0xc2080fcf00, 0xc2080fd080)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:238 +0x106
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:247 +0x877

goroutine 88 [runnable]:
sync.(*WaitGroup).Wait(0xc2082631c0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/sync/waitgroup.go:132 +0x169
github.com/hashicorp/terraform/dag.func·004()
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:173 +0x52
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:174 +0x1b7

goroutine 69 [IO wait]:
net.(*pollDesc).Wait(0xc2080aaf40, 0x72, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).WaitRead(0xc2080aaf40, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/fd_poll_runtime.go:89 +0x43
net.(*netFD).Read(0xc2080aaee0, 0xc20827e800, 0x800, 0x800, 0x0, 0xf11f88, 0xc2082669e8)
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/fd_unix.go:242 +0x40f
net.(*conn).Read(0xc20802e480, 0xc20827e800, 0x800, 0x800, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/net.go:121 +0xdc
crypto/tls.(*block).readFromUntil(0xc2082a5020, 0xf15c18, 0xc20802e480, 0x5, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/crypto/tls/conn.go:454 +0xe6
crypto/tls.(*Conn).readRecord(0xc208068580, 0x17, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/crypto/tls/conn.go:539 +0x2da
crypto/tls.(*Conn).Read(0xc208068580, 0xc2080a1000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/crypto/tls/conn.go:904 +0x166
net/http.noteEOFReader.Read(0xf1f150, 0xc208068580, 0xc20804c7e8, 0xc2080a1000, 0x1000, 0x1000, 0x6990c0, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/http/transport.go:1270 +0x6e
net/http.(*noteEOFReader).Read(0xc2081e9d00, 0xc2080a1000, 0x1000, 0x1000, 0xc208012000, 0x0, 0x0)
    <autogenerated>:125 +0xd4
bufio.(*Reader).fill(0xc2080fdc80)
    /usr/local/Cellar/go14/1.4.2/libexec/src/bufio/bufio.go:97 +0x1ce
bufio.(*Reader).Peek(0xc2080fdc80, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/Cellar/go14/1.4.2/libexec/src/bufio/bufio.go:132 +0xf0
net/http.(*persistConn).readLoop(0xc20804c790)
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/http/transport.go:842 +0xa4
created by net/http.(*Transport).dialConn
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/http/transport.go:660 +0xc9f

goroutine 89 [runnable]:
github.com/hashicorp/terraform/dag.func·005(0x7ee280, 0xc2082520f0, 0xc7f058, 0x0, 0x0, 0xc7f058, 0x0, 0x0, 0xc20810fe00)
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:228 +0x4c7
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
    /Users/James/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:229 +0x730

goroutine 81 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/Cellar/go14/1.4.2/libexec/src/runtime/asm_amd64.s:2232 +0x1

goroutine 70 [select]:
net/http.(*persistConn).writeLoop(0xc20804c790)
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/http/transport.go:945 +0x41d
created by net/http.(*Transport).dialConn
    /usr/local/Cellar/go14/1.4.2/libexec/src/net/http/transport.go:661 +0xcbc
exit status 2
FAIL    github.com/hashicorp/terraform/builtin/providers/azurerm    4.746s
make: *** [testacc] Error 1


// fetch the 'address_space_prefix'es:
prefixes := []string{}
for _, pref := range d.Get("addres_space").([]interface{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is likely causing the panic mentioned below. Should be address_space I think?

@jen20
Copy link
Contributor

jen20 commented Dec 17, 2015

Hi @aznashwan! Thanks for your work on this. I've submitted a pull request back to your branch which makes the acceptance tests pass and matches the patterns established by the exemplar resources. If you could review the changes, verify them for yourself by running the tests, and update here that would be great! The diffs should give a good idea of what is needed for the other open resource PRs as well. Thanks!

aznashwan and others added 2 commits December 23, 2015 18:49
This diff represents the changes  necessary to make local network
gateway tests pass:

- Parse the resource ID instead of relying on attributes
- Remove unecessary logging (which is handled via the autorest wrapper)
- Resource GUID is removed - if this is actually required for anything
  we may need to find a way to supress it during apply, as we get
  spurious diffs in plans otherwise.
- Various typos fixed.
@aznashwan
Copy link
Contributor Author

@jen20: thanks for the updates; they have been picked in here.

@jen20
Copy link
Contributor

jen20 commented Dec 31, 2015

Thanks @aznashwan! Happy New Year!

jen20 added a commit that referenced this pull request Dec 31, 2015
provider/azure: added local network gateway resource
@jen20 jen20 merged commit 9da5dec into hashicorp:master Dec 31, 2015
@jen20 jen20 changed the title provider/azure: added local network gateway resource provider/azurerm: added local network gateway resource Dec 31, 2015
@ghost
Copy link

ghost commented Apr 29, 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 29, 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.

2 participants