Closed adambarreiro closed 2 years ago
Converting back to Draft as I'll need to adapt the changes to a few additions in https://github.com/vmware/terraform-provider-vcd/pull/904
Converting back to Draft as I'll need to upgrade to v2.0.0 for ComputePolicies endpoint as there's a quirk with the Description
field. In v1.0.0, if it's empty, the API puts a default description message, which makes VM Sizing Policy and VM Placement Policy resources to always update even nothing was changed in HCL.
This PR builds on top of #502.
Description
Same as #502, this PR aims to serve as the foundation for https://github.com/vmware/terraform-provider-vcd/pull/904. This PR contains the required changes to be able to create the
vcd_vm_placement_policy
resource to be able to test it.As
vcd_vm_placement_policy
requires to handle VM Groups and Logical VM Groups in VCD, there are additions of some functions for that purpose.It also updates Compute Policies OpenAPI support from v1.0.0 to v2.0.0, marking v1.0.0 as deprecated and leaving it untouched, while creating a new set of functions for the new version to avoid breaking compatibility. This change was done to support more filtering options of the v2.0.0 endpoint and prepare for the future.
Other changes
Description
field inVdcComputePolicy
is now a pointer and is not omitted when empty. This is because we need to send an explicit nil/null value to the VCD API to be able to declare empty descriptions. Otherwise, if the parameter is omitted, VCD puts a default description.Testing
Tests require a new field in govcd_test_config.yaml: