0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-01 11:02:59 +00:00
terraform-provider-proxmox/proxmoxtf
Oto Petřík e15c4a6784
fix(vm): Make mac_address computed, fix #339 (#354)
Fields `network_interface_names`, `ipv4_addresses` and `ipv6_addresses`
are sometimes be marked `computed` again, using `CustomizeDiff`.
Changes in `VMStarted` or `VMNetworkDevice` attributes invalidate
those values. Marking fields `computed` again avoids stale values.

`network_device` configuration block without `mac_address` results
in MAC address set to its default value (an empty string).
Terraform state expects `mac_address` to be an empty string, server
provides the actual (random) MAC address of the network device.
Terraform detects there are changes to be made, but because of
`DiffSuppressFunc` on `mac_address` they are hidden from the user,
but not from d.HasChange(mkResourceVirtualEnvironmentVMNetworkDevice)

By making `mac_address` also `computed`, the server-generated MAC
address is stored locally, avoiding spurious changes that trigger
re-computation of `network_interface_names`, `ipv4_addresses` and
`ipv6_addresses`.
2023-05-31 21:12:27 -04:00
..
datasource feat: API client cleanup and refactoring (#323) 2023-05-26 01:32:51 +00:00
provider feat(core): Add API Token authentication (#350) 2023-05-29 21:56:21 -04:00
resource fix(vm): Make mac_address computed, fix #339 (#354) 2023-05-31 21:12:27 -04:00
structure feat: API client cleanup and refactoring (#323) 2023-05-26 01:32:51 +00:00
test feat: API client cleanup and refactoring (#323) 2023-05-26 01:32:51 +00:00
config.go feat: API client cleanup and refactoring (#323) 2023-05-26 01:32:51 +00:00