-
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
fix delete and import for redundant l2 connections #103
Conversation
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.
Without redundantUUID field returned from the API there is no way to know if it is a redundant connection just with the primary connection ID, since all connections both single and redundant have a redundancyGroup.
Should we add a data source for querying a connection based on any combination of the following filters:
- connection id
- redundancy group
- primary/secondary
- others?
Is this the only way users would be able to get Terraform details for the redundant connection?
Since secondary connection has its own UUID/name it could be retrieved independently:
|
Codecov Report
@@ Coverage Diff @@
## master #103 +/- ##
==========================================
- Coverage 61.70% 61.15% -0.56%
==========================================
Files 65 65
Lines 11134 11061 -73
==========================================
- Hits 6870 6764 -106
- Misses 4013 4044 +31
- Partials 251 253 +2
Continue to review full report at Codecov.
|
return nil, "", err | ||
restErr, ok := err.(rest.Error) | ||
if ok { | ||
// IC-LAYER2-4021 = Connection already deleted |
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.
nit: this could be ok && ...
fix delete and import for redundant l2 connections
Description:
Field
RedundantUUID
was used to check if there was a secondary connection. This field is not been returned for new connections anymore. This field can be deleted from the schema but then it will be required a full scan for all connections in the read function to ensure theterraform import
command works also for redundant connections.From terraform import function docs:
Without
redundantUUID
field returned from the API there is no way to know if it is a redundant connection just with the primary connection ID, since all connections both single and redundant have aredundancyGroup
. Therefore it will be needed a full scan in the read function to search for a connection with same RedundancyGroup.To handle that without a full scan I propose to keep
RedundantUUID
but without using the value returned from the API. Instead value will be set in:terraform-provider-equinix/equinix/resource_ecx_l2_connection.go
Lines 620 to 625 in e13dbf1
terraform-provider-equinix/equinix/resource_ecx_l2_connection.go
Lines 130 to 141 in e13dbf1
Depends on:
Tasks: