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

d/azurerm_network_interface: Support for gateway_load_balancer_frontend_ip_configuration_id to prevent nilpointer #13865

Merged
merged 2 commits into from
Oct 25, 2021

Conversation

aristosvo
Copy link
Collaborator

@aristosvo aristosvo commented Oct 22, 2021

Fixes #13858
Fixes #13918
Error introduced in #13559

  • Docs

Reproduction via AccTest

❯ go install && make acctests SERVICE='network' TESTARGS='-run=TestAccDataSourceArmNetworkInterface_basic'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/network -run=TestAccDataSourceArmNetworkInterface_basic -timeout 180m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccDataSourceArmNetworkInterface_basic
=== PAUSE TestAccDataSourceArmNetworkInterface_basic
=== CONT  TestAccDataSourceArmNetworkInterface_basic
panic: Invalid address to set: []string{"ip_configuration", "0", "gateway_load_balancer_frontend_ip_configuration_id"}

goroutine 1330 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc002a58b80, 0x74e8fd0, 0x10, 0x6a014e0, 0xc0027a1ae8, 0x0, 0x0)
        /Users/aris/git/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:230 +0x371
github.com/hashicorp/terraform-provider-azurerm/internal/services/network.dataSourceNetworkInterfaceRead(0xc002a58b80, 0x6bc6a40, 0xc00157ca80, 0x0, 0x0)
        /Users/aris/git/terraform-provider-azurerm/internal/services/network/network_interface_data_source.go:225 +0x8f7
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0005dda40, 0x7d7f7e8, 0xc004061580, 0xc002a58b80, 0x6bc6a40, 0xc00157ca80, 0x0, 0x0, 0x0)
        /Users/aris/git/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:335 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0005dda40, 0x7d7f7e8, 0xc004061580, 0xc003675be0, 0x6bc6a40, 0xc00157ca80, 0xc00157ca80, 0xc003675be0, 0x0, 0x0)
        /Users/aris/git/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:558 +0xfd
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc002c34cd8, 0x7d7f7e8, 0xc004061580, 0xc003675960, 0xc004061580, 0x100d725, 0x6f2a3a0)
        /Users/aris/git/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:1105 +0x4d6
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ReadDataSource(0xc000e0dcc0, 0x7d7f890, 0xc004061580, 0xc003045cc0, 0xc000e0dcc0, 0xc0042960f0, 0xc001ddfba0)
        /Users/aris/git/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/server/server.go:247 +0xe5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler(0x710a080, 0xc000e0dcc0, 0x7d7f890, 0xc0042960f0, 0xc001194000, 0x0, 0x7d7f890, 0xc0042960f0, 0xc0036b0000, 0x182)
        /Users/aris/git/terraform-provider-azurerm/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:416 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0014d0000, 0x7dd35b8, 0xc004ab8f00, 0xc0036ac900, 0xc002f34d80, 0xbb2f350, 0x0, 0x0, 0x0)
        /Users/aris/git/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1292 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc0014d0000, 0x7dd35b8, 0xc004ab8f00, 0xc0036ac900, 0x0)
        /Users/aris/git/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:1617 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc00185e850, 0xc0014d0000, 0x7dd35b8, 0xc004ab8f00, 0xc0036ac900)
        /Users/aris/git/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:940 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /Users/aris/git/terraform-provider-azurerm/vendor/google.golang.org/grpc/server.go:938 +0x1fd
FAIL    github.com/hashicorp/terraform-provider-azurerm/internal/services/network       76.235s
FAIL
make: *** [acctests] Error 1

Fixed according to AccTest

❯ go install && make acctests SERVICE='network' TESTARGS='-run=TestAccDataSourceArmNetworkInterface_basic'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/network -run=TestAccDataSourceArmNetworkInterface_basic -timeout 180m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccDataSourceArmNetworkInterface_basic
=== PAUSE TestAccDataSourceArmNetworkInterface_basic
=== CONT  TestAccDataSourceArmNetworkInterface_basic
--- PASS: TestAccDataSourceArmNetworkInterface_basic (228.14s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/network       229.711s

…ntend_ip_configuration_id` to prevent nilpointer
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @aristosvo - LGTM 🤕

@katbyte katbyte merged commit 437ddf2 into hashicorp:main Oct 25, 2021
@aristosvo aristosvo deleted the network/nic-data-source-gwlbfeipcfg branch October 25, 2021 19:34
@github-actions
Copy link

This functionality has been released in v2.83.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2021
@aristosvo aristosvo restored the network/nic-data-source-gwlbfeipcfg branch April 14, 2023 07:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants