Skip to content
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(lb): wait on read lb and add wait to sweeper test. #1028

Merged
merged 4 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scaleway/resource_lb.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func resourceScalewayLbRead(ctx context.Context, d *schema.ResourceData, meta in
}

retryInterval := DefaultWaitLBRetryInterval
res, err := lbAPI.WaitForLb(&lb.ZonedAPIWaitForLBRequest{
res, err := lbAPI.WaitForLbInstances(&lb.ZonedAPIWaitForLBInstancesRequest{
Zone: zone,
LBID: ID,
Timeout: scw.TimeDurationPtr(defaultInstanceServerWaitTimeout),
Expand Down
2 changes: 1 addition & 1 deletion scaleway/resource_lb_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func testAccCheckScalewayLbIPDestroy(tt *TestTools) resource.TestCheckFunc {

lbID, lbExist := rs.Primary.Attributes["lb_id"]
if lbExist && len(lbID) > 0 {
_, err = lbAPI.WaitForLb(&lb.ZonedAPIWaitForLBRequest{
_, err = lbAPI.WaitForLbInstances(&lb.ZonedAPIWaitForLBInstancesRequest{
Zone: zone,
LBID: lbID,
Timeout: scw.TimeDurationPtr(defaultInstanceServerWaitTimeout),
Expand Down
9 changes: 9 additions & 0 deletions scaleway/resource_lb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ func testSweepLB(_ string) error {
}

for _, l := range listLBs.LBs {
_, err = lbAPI.WaitForLbInstances(&lb.ZonedAPIWaitForLBInstancesRequest{
LBID: l.ID,
Zone: zone,
Timeout: scw.TimeDurationPtr(LbWaitForTimeout),
RetryInterval: scw.TimeDurationPtr(DefaultWaitLBRetryInterval),
})
if err != nil {
return fmt.Errorf("error waiting for lb in sweeper: %s", err)
}
err := lbAPI.DeleteLB(&lb.ZonedAPIDeleteLBRequest{
LBID: l.ID,
ReleaseIP: true,
Expand Down
312 changes: 156 additions & 156 deletions scaleway/testdata/data-source-lb-basic.cassette.yaml

Large diffs are not rendered by default.

192 changes: 96 additions & 96 deletions scaleway/testdata/data-source-lbip-basic.cassette.yaml

Large diffs are not rendered by default.

560 changes: 280 additions & 280 deletions scaleway/testdata/lb-backend-basic.cassette.yaml

Large diffs are not rendered by default.

582 changes: 291 additions & 291 deletions scaleway/testdata/lb-backend-health-check.cassette.yaml

Large diffs are not rendered by default.

730 changes: 365 additions & 365 deletions scaleway/testdata/lb-certificate-basic.cassette.yaml

Large diffs are not rendered by default.

580 changes: 290 additions & 290 deletions scaleway/testdata/lb-frontend-basic.cassette.yaml

Large diffs are not rendered by default.

376 changes: 188 additions & 188 deletions scaleway/testdata/lb-route-basic.cassette.yaml

Large diffs are not rendered by default.

772 changes: 386 additions & 386 deletions scaleway/testdata/lbacl-basic.cassette.yaml

Large diffs are not rendered by default.

330 changes: 165 additions & 165 deletions scaleway/testdata/lbip-basic.cassette.yaml

Large diffs are not rendered by default.

1,722 changes: 828 additions & 894 deletions scaleway/testdata/lblb-with-ip.cassette.yaml

Large diffs are not rendered by default.