-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: convert virtual circuit resource & datasource to equinix-sdk-go #700
Conversation
db7cc99
to
366891b
Compare
366891b
to
0447951
Compare
Noting some failed sweeps:
|
4e923ae
to
8c27e35
Compare
Some sweeper errors persist:
|
client := meta.(*config.Config).NewMetalClientForSDK(d) | ||
needsUpdate := false | ||
|
||
ur := metalv1.VirtualCircuitUpdateInput{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to think there is some pattern to be used across this resource that would have collapsed the if vrf {} else vlan {}
blocks in this PR.
That could look like this:
type VCCommon interface {
GetHref() string
GetID() string
Set...
}
Where that quickly falls apart is in the enum inputs/outputs and other one-off differences between VirtualCircuit types, such as int
reference vs *int
for NNID fields.
Within resourceMetalVirtualCircuitUpdate
, it is more obvious to see how we could apply that pattern. We did so in metal-cli.
equinix/metal-cli#369 (comment)
I only mention this for posterity. Not looking for this PR to adopt this pattern.
b50e3e9
to
9b74aff
Compare
9b74aff
to
32e3025
Compare
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. |
29e0864
to
50a06ce
Compare
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.