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

fix(vm): Make mac_address computed, fix #339 #354

Merged
merged 1 commit into from
Jun 1, 2023

Commits on May 31, 2023

  1. fix(vm): Make mac_address computed, fix bpg#339

    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`.
    otopetrik committed May 31, 2023
    Configuration menu
    Copy the full SHA
    b51bb20 View commit details
    Browse the repository at this point in the history