Closed ctreatma closed 2 weeks ago
Noting some failed sweeps:
2024/06/18 22:09:56 Sweeper Tests for region (all) ran unsuccessfully:
2024/06/18 22:09:56 - equinix_metal_vrf: Error deleting VRFs DELETE https://api.equinix.com/metal/v1/vrfs/97b74582-92ab-4df3-af96-a2efe41e3e97: 422 Cannot delete VRF with associated Virtual Circuits, please delete any associated virtual circuits first
2024/06/18 22:09:56 - equinix_metal_project: 2 errors occurred:
* Error deleting project DELETE https://api.equinix.com/metal/v1/projects/47b9d47f-57fd-4e3d-aa0c-d0b812bd18ce: 422 Cannot delete a project with active virtual circuits.
* Error deleting project DELETE https://api.equinix.com/metal/v1/projects/d3[135](https://github.com/equinix/terraform-provider-equinix/actions/runs/9572657239/job/26392474481?pr=700#step:7:136)1a8-fb6f-4b76-b835-4453971adec7: 422 Cannot delete a project with active virtual circuits.
2024/06/18 22:09:56 - equinix_metal_virtual_circuit: error getting organization list for sweeping VirtualCircuits: no value given for required property address
Some sweeper errors persist:
2024/06/19 16:46:55 Sweeper Tests for region (all) ran unsuccessfully:
2024/06/19 16:46:55 - equinix_metal_project: 1 error occurred:
* Error deleting project DELETE https://api.equinix.com/metal/v1/projects/f096688e-166d-42f1-9959-9acf97ebc8a1: 422 cannot delete when associated to a virtual circuit
2024/06/19 16:46:55 - equinix_metal_vlan: Error deleting vlan DELETE https://api.equinix.com/metal/v1/virtual-networks/851f2fc7-bfc1-4a9b-b8a7-4a8ec4e125f1: 422 Cannot delete Virtual Network when associated to a virtual circuit
FAIL github.com/equinix/terraform-provider-equinix/internal/sweep 7.564s
FAIL
The remaining sweeper errors seem to pre-date this PR: https://github.com/equinix/terraform-provider-equinix/actions/runs/9503755717/job/26194913301#step:7:146
The connection in question does not have any virtual circuits associated, so it appears they were deleted, just not in time for the subsequent sweeper. That's a problem that impacts our sweepers in general: at a glance, approximately none of them wait for swept resources to disappear; they just assume that if the delete request passed, all is well.
This updates the
metal_virtual_circuit
resource and data source to useequinix-sdk-go
instead ofpackngo
. As mentioned in #402, thepackngo
SDK has been deprecated, and moving toequinix-sdk-go
makes it possible for these resources to gain new features in the future.As an added bonus, the affected code has also been moved to
internal/resources/metal
to align with #106.