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

compute: Add user_data to VM & VMSS resources #13888

Merged
merged 8 commits into from
Dec 18, 2021

Conversation

mouellet
Copy link
Contributor

@mouellet mouellet commented Oct 25, 2021

Fix for #11846

@rgl

This comment has been minimized.

@et304383

This comment has been minimized.

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

hey @mouellet

Thanks for this PR - apologies for the delay reviewing this.

I've taken a look through and left some comments inline - since the design of Custom Data within a Virtual Machine and Virtual Machine Scale Sets has quite a unique behaviour, in order to review this PR I ended up having to pull this down locally to confirm if this also applies to User Data.

For context, the issue with Custom Data is that this also a Base64 encoded string available at provisioning time - however this isn't returned from the Azure API (which is why in the acceptance tests we're ignoring the value of this field). Having looked into this, this value is returned for this field (which makes sense as this is available via the Instance MetaData Endpoint) so we're good here (and can ensure this is set into the state / remove the ignore checks for this field).

As I mentioned since I've pulled this down locally and some left comments inline, so I hope you don't mind but I'm going to push a few commits to resolve the outstanding comments - but as this otherwise looks good to me I'll kick off the acceptance tests now and we should be able to get this merged shortly 👍

Thanks!

@tombuildsstuff tombuildsstuff removed their assignment Dec 17, 2021
@tombuildsstuff tombuildsstuff added this to the v2.91.0 milestone Dec 17, 2021
@katbyte
Copy link
Collaborator

katbyte commented Dec 17, 2021

test failure:

Test ended in panic.

------- Stdout: -------
=== RUN   TestAccWindowsVirtualMachineScaleSet_disksDataDiskMultiple
=== PAUSE TestAccWindowsVirtualMachineScaleSet_disksDataDiskMultiple
=== CONT  TestAccWindowsVirtualMachineScaleSet_disksDataDiskMultiple

------- Stderr: -------
panic: Invalid address to set: []string{"user_daa"}

goroutine 533 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).Set(0xc000320280, {0x5fc95c6, 0x8}, {0x54eb500, 0x0})
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource_data.go:230 +0x2a5
github.com/hashicorp/terraform-provider-azurerm/internal/services/compute.resourceWindowsVirtualMachineScaleSetRead(0xc000320280, {0x56d3240, 0xc000bfe700})
	/opt/teamcity-agent/work/5e6516bb4d10eb66/internal/services/compute/windows_virtual_machine_scale_set_resource.go:1196 +0x2085
github.com/hashicorp/terraform-provider-azurerm/internal/services/compute.resourceWindowsVirtualMachineScaleSetCreate(0x0, {0x56d3240, 0xc000bfe700})
	/opt/teamcity-agent/work/5e6516bb4d10eb66/internal/services/compute/windows_virtual_machine_scale_set_resource.go:639 +0x3747
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc001d14ab0, {0x67f9218, 0xc001af96c0}, 0x2, {0x56d3240, 0xc000bfe700})
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:329 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc002a82b60, {0x67f9218, 0xc001af96c0}, 0xc001f080d0, 0xc000beff00, {0x56d3240, 0xc000bfe700})
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go:467 +0x871
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0007e0018, {0x67f9218, 0xc001af96c0}, 0xc001612af0)
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go:977 +0xd8a
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc002564200, {0x67f92c0, 0xc001ac60f0}, 0xc0012ee4d0)
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server/server.go:603 +0x30e
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x5c22340, 0xc002564200}, {0x67f92c0, 0xc001ac60f0}, 0xc001aedd40, 0x0)
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc001bd4000, {0x6848df0, 0xc00204ad80}, 0xc001ac0240, 0xc003d5ec00, 0xae183c0, 0x0)
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:1292 +0xc6f
google.golang.org/grpc.(*Server).handleStream(0xc001bd4000, {0x6848df0, 0xc00204ad80}, 0xc001ac0240, 0x0)
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:1617 +0xa2a
google.golang.org/grpc.(*Server).serveStreams.func1.2()
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:940 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
	/opt/teamcity-agent/work/5e6516bb4d10eb66/vendor/google.golang.org/grpc/server.go:938 +0x294

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 LGTM 🍰

@katbyte katbyte merged commit adb4525 into hashicorp:main Dec 18, 2021
katbyte added a commit that referenced this pull request Dec 18, 2021
@github-actions
Copy link

github-actions bot commented Jan 7, 2022

This functionality has been released in v2.91.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

github-actions bot commented Feb 7, 2022

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 Feb 7, 2022
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.

6 participants