Fixed issue causing an empty list of placement groups gets added to the instance state, even when none are defined.
✔️ How to Test
The following steps assume that you pulled down this PR locally.
First, verify that instance-related integration tests are passing, i.e.
make PKG_NAME=linode/instance ARGS="-run TestAccDataSourceInstances_basic" int-test
Generate a compliant firewall in Cloud Manager.
Initialize terraform in a sandbox environment, i.e. dx-devenv.
Create a placement group and instance resource with the firewall's id, and assign the instance to that PG
resource "linode_instance" "foobar" {
label = "test-tf-instance"
type = "g6-standard-1"
region = "us-mia"
image = "linode/alpine3.19"
firewall_id =
placement_group {
id = linode_placement_group.test.id
}
}
4. Go to Cloud Manager and unassign the instance from the PG
5. Run `make plan` and verify that there is an update in-place to add the instance back to the PG
6. Destroy all resources created for this test
📝 Description
Fixed issue causing an empty list of placement groups gets added to the instance state, even when none are defined.
✔️ How to Test
The following steps assume that you pulled down this PR locally.
First, verify that instance-related integration tests are passing, i.e.
make PKG_NAME=linode/instance ARGS="-run TestAccDataSourceInstances_basic" int-test
resource "linode_instance" "foobar" { label = "test-tf-instance" type = "g6-standard-1" region = "us-mia" image = "linode/alpine3.19" firewall_id =
placement_group {
id = linode_placement_group.test.id
}
}