Skip to content

Commit

Permalink
Update fivetran_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-aleksandrboldyrev committed Oct 2, 2024
1 parent a5d4066 commit ec79c25
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions fivetran/tests/e2e/fivetran_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func cleanupAccount() {
cleanupWebhooks()
cleanupTeams()
cleanupProxyAgents()
cleanupPrivateLinks()
cleanupHybridDeploymentAgents()
}

Expand Down Expand Up @@ -277,6 +278,23 @@ func cleanupProxyAgents() {
}
}

func cleanupPrivateLinks() {
plList, err := client.NewPrivateLinkList().Do(context.Background())
if err != nil {
log.Fatal(err)
}
for _, pl := range plList.Data.Items {
_, err := client.NewPrivateLinkDelete().PrivateLinkId(pl.Id).Do(context.Background())
if err != nil {
log.Fatal(err)
}
}

if plList.Data.NextCursor != "" {
cleanupPrivateLinks()
}
}

func cleanupHybridDeploymentAgents() {
lpaList, err := client.NewHybridDeploymentAgentList().Do(context.Background())
if err != nil {
Expand Down

0 comments on commit ec79c25

Please sign in to comment.