hashicorp / hashicorp/packer-plugin-azure
False Positive Error returned for multiple subnets with virtual network
- Dominant language
- Go
- Stars
- 63
- Forks
- 103
- PR merge metrics
- No merged PRs in 30d
Description
#### Overview of the Issue
AzureRM Builder plugin package
If a `virtual_network_name` value is assigned with multiple subnets associated with that vnet, then an [error](https://github.com/hashicorp/packer-plugin-azure/blob/1b209f585b32e3a4b9fbe5b990e35d9892dd3e92/builder/azure/arm/resource_resolver.go#L139) is correctly returned. If additionally the specific `virtual_network_subnet_name` value is assigned, then the same error is incorrectly returned. The error is no longer returned when the `virtual_network_resource_group_name` is assigned a value, which should not occur because the subnet is explicitly specified, and the error string even states that the resource group is correctly determined. I am unsure what is triggering the false positive on the error return, but adding an extraneous parameter with the same value that the plugin states it is correctly determining prevents the false positive error return.
#### Reproduction Steps
Assign values for `virtual_network_name` and `virtual_network_subnet_name`, but not `virtual_network_resource_group_name`.
`packer build `
### Plugin and Packer version
Packer 1.10.3
Plugin 2.1.6
### Simplified Packer Buildfile
See reproduction steps section.
### Operating system and Environment details
N/A
### Log Fragments and crash.log files
See Overview section.
Contributor guide
Research direction
Start in builder/azure/arm/resource_resolver.go around the linked error at line 139, then reproduce with virtual_network_name and virtual_network_subnet_name set but no virtual_network_resource_group_name. Compare that path with the same build including the resource group; done means the explicitly selected subnet no longer triggers the false-positive error while multiple unspecified subnets still do.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, go
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100