From 090607d3de2993dde6891fbc2ff9ac2b4856f546 Mon Sep 17 00:00:00 2001 From: Dom Del Nano Date: Mon, 18 Mar 2024 21:34:04 -0700 Subject: [PATCH] Fix issue with failing test and update docs Signed-off-by: Dom Del Nano --- docs/resources/vm.md | 2 +- xoa/resource_xenorchestra_vm.go | 9 +++++---- xoa/resource_xenorchestra_vm_test.go | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/resources/vm.md b/docs/resources/vm.md index 0072eb6..842fb18 100644 --- a/docs/resources/vm.md +++ b/docs/resources/vm.md @@ -216,7 +216,7 @@ Required: Optional: - `attached` (Boolean) Whether the device should be attached to the VM. -- `expected_ip_cidr` (String) Whether terraform should wait until IP addresses are present on the VM's network interfaces before considering it created. This only works if guest-tools are installed in the VM. Defaults to false. +- `expected_ip_cidr` (String) Determines the IP cidr range terraform should watch for on this network interface. Resource creation is not complete until the IP address converges to the specified range. This only works if guest-tools are installed in the VM. Defaults to "", which skips IP address matching. - `mac_address` (String) The mac address of the network interface. This must be parsable by go's [net.ParseMAC function](https://golang.org/pkg/net/#ParseMAC). All mac addresses are stored in Terraform's state with [HardwareAddr's string representation](https://golang.org/pkg/net/#HardwareAddr.String) i.e. 00:00:5e:00:53:01 Read-Only: diff --git a/xoa/resource_xenorchestra_vm.go b/xoa/resource_xenorchestra_vm.go index b990c41..cae8fa1 100644 --- a/xoa/resource_xenorchestra_vm.go +++ b/xoa/resource_xenorchestra_vm.go @@ -352,10 +352,11 @@ $ xo-cli xo.getAllObjects filter='json:{"id": "cf7b5d7d-3cd5-6b7c-5025-5c935c8cd }, }, "expected_ip_cidr": &schema.Schema{ - Type: schema.TypeString, - Default: "", - Description: "Whether terraform should wait until IP addresses are present on the VM's network interfaces before considering it created. This only works if guest-tools are installed in the VM. Defaults to false.", - Optional: true, + Type: schema.TypeString, + Default: "", + Description: "Determines the IP cidr range terraform should watch for on this network interface. Resource creation is not complete until the IP address converges to the specified range. This only works if guest-tools are installed in the VM. Defaults to \"\", which skips IP address matching.", + Optional: true, + DiffSuppressFunc: suppressAttachedDiffWhenHalted, }, }, }, diff --git a/xoa/resource_xenorchestra_vm_test.go b/xoa/resource_xenorchestra_vm_test.go index 94b470a..0af101e 100644 --- a/xoa/resource_xenorchestra_vm_test.go +++ b/xoa/resource_xenorchestra_vm_test.go @@ -2108,7 +2108,7 @@ resource "xenorchestra_vm" "bar" { } func testAccVmConfig(vmName string) string { - return testAccVmConfigWithWaitForIp(vmName, "0.0.0.0/0") + return testAccVmConfigWithWaitForIp(vmName, "") } func testAccVmConfigWithWaitForIp(vmName, expectedIpCidr string) string {