mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
aws backendgroup delete bugfix
This commit is contained in:
@@ -61,6 +61,11 @@ func WaitStatusWithInstanceErrorCheck(res ICloudResource, expect string, interva
|
||||
return ErrTimeout
|
||||
}
|
||||
|
||||
func WaitDeletedWithDelay(res ICloudResource, delay time.Duration, interval time.Duration, timeout time.Duration) error {
|
||||
time.Sleep(delay)
|
||||
return WaitDeleted(res, interval, timeout)
|
||||
}
|
||||
|
||||
func WaitDeleted(res ICloudResource, interval time.Duration, timeout time.Duration) error {
|
||||
startTime := time.Now()
|
||||
for time.Now().Sub(startTime) < timeout {
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/errors"
|
||||
@@ -1217,6 +1218,11 @@ func (self *SAwsRegionDriver) RequestDeleteLoadbalancer(ctx context.Context, use
|
||||
}
|
||||
}
|
||||
|
||||
err = cloudprovider.WaitDeletedWithDelay(iLoadbalancer, 10*time.Second, 10*time.Second, 60*time.Second)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "AwsRegionDriver.RequestDeleteLoadbalancer.WaitDeleted")
|
||||
}
|
||||
|
||||
// delete backendgroups
|
||||
{
|
||||
// delete remote lbbgs
|
||||
|
||||
Reference in New Issue
Block a user