Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-aleksandrboldyrev committed Oct 8, 2024
1 parent 2743a61 commit f4104c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions fivetran/framework/resources/private_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@ func (r *privateLink) Delete(ctx context.Context, req resource.DeleteRequest, re

resp.Diagnostics.Append(req.State.Get(ctx, &data)...)

// check availability of PL
response, err := r.GetClient().NewPrivateLinkDetails().PrivateLinkId(data.Id.ValueString()).Do(ctx)
if err != nil && err.Error() != "status code: 404; expected: 200" {
resp.Diagnostics.AddError(
"Unable to Delete Private Link Resource.",
fmt.Sprintf("%v; code: %v; message: %v", err, response.Code, response.Message),
)
return
}

deleteResponse, err := r.GetClient().NewPrivateLinkDelete().PrivateLinkId(data.Id.ValueString()).Do(ctx)
if err != nil {
resp.Diagnostics.AddError(
Expand Down
2 changes: 1 addition & 1 deletion fivetran/tests/e2e/resource_private_link_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func testFivetranPrivateLinkResourceDestroy(s *terraform.State) error {
}

response, err := client.NewPrivateLinkDetails().PrivateLinkId(rs.Primary.ID).Do(context.Background())
if err.Error() != "status code: 404; expected: 200" {
if err != nil && err.Error() != "status code: 404; expected: 200" {
return err
}
if !strings.HasPrefix(response.Code, "NotFound") {
Expand Down

0 comments on commit f4104c4

Please sign in to comment.