Skip to content

chore: Add PENDING_INTERFACE_CONFIGURATION to sweepable connection state - #1050

Open
tng1-equinix wants to merge 1 commit into
mainfrom
fixes
Open

tng1-equinix wants to merge 1 commit into
mainfrom
fixes

Conversation

@tng1-equinix

Copy link
Copy Markdown
Contributor

No description provided.

@tng1-equinix
tng1-equinix requested a review from a team as a code owner July 14, 2026 06:34
Copilot AI review requested due to automatic review settings July 14, 2026 06:34
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.64%. Comparing base (cedc652) to head (d4fa122).

Files with missing lines Patch % Lines
internal/resources/fabric/connection/sweeper.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1050      +/-   ##
==========================================
+ Coverage   70.33%   70.64%   +0.31%     
==========================================
  Files         177      177              
  Lines       21826    21826              
==========================================
+ Hits        15351    15419      +68     
+ Misses       5673     5593      -80     
- Partials      802      814      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Fabric connection test sweeper so it can also find and delete test connections that are stuck in the PENDING_INTERFACE_CONFIGURATION state, helping prevent leaked resources during acceptance test cleanup.

Changes:

  • Expanded the connection search filter to include PENDING_INTERFACE_CONFIGURATION in addition to PROVISIONED.

Comment on lines 54 to +56
Property: &equinixStatus,
Operator: &equalOperator,
Values: []string{string(fabricv4.EQUINIXSTATUS_PROVISIONED)},
Values: []string{string(fabricv4.EQUINIXSTATUS_PROVISIONED), string(fabricv4.EQUINIXSTATUS_PENDING_INTERFACE_CONFIGURATION)},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation shows that the equalOperator can accept a list of values (ACTIVE and REPROVISIONING are given in the example): https://docs.equinix.com/fabric/fabric-api/getting-port-info#search-for-ports

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tng1-equinix Are these the only two connection statuses you want to sweep? The filter is already prefix checked. Is the status check even necessary? Are any status values going to indicate that we should not sweep the test prefixed connection?

func AddTestSweeper() {
resource.AddTestSweepers("equinix_fabric_connection", &resource.Sweeper{
Name: "equinix_fabric_connection",
Dependencies: []string{},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the dependencies of a connection?
What things should be deleting/deconstructed/deconfigured before it is safe to delete a connection? What must be deleted first to unblock deletion?

equinix/internal/sweep","Output":"2026/07/14 06:45:03 \t- equinix_fabric_network: error deleting network: 400 Bad Request Code: EQ-3152019, Message: Network cannot be deleted with active connections, Details: Active connection count: 1\n"***
***"Time":"2026-07-14T06:45:03.848493627Z","Action":"output","Package":"github.com/equinix/terraform-provider-equinix/internal/sweep","Output":"error deleting network: 400 Bad Request Code: EQ-3152019, Message: Network cannot be deleted with active connections, Details: Active connection count: 1\n"***
***"Time":"2026-07-14T06:45:03.848499297Z","Action":"output","Package":"github.com/equinix/terraform-provider-equinix/internal/sweep","Output":"error deleting network: 400 Bad Request Code: EQ-3152019, Message: Network cannot be deleted with active connections, Details: Active connection count: 1\n"***

This branch was previously deployed

1 inactive deployment
internal d4fa122e Deployed Jul 14, 2026 by tng1-equinix via authorize #2791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants