Skip to content

Commit e6b0d2e

Browse files
authored
safe app deletion always retry on any error (#567)
* safe app deletion always retry on any error * remove unused import
1 parent c38276a commit e6b0d2e

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

cloudfoundry/managers/v3appdeployers/bluegreen_strategy_v3.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"io/ioutil"
77
"log"
8-
"regexp"
98
"time"
109

1110
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
@@ -467,16 +466,11 @@ func SafeAppDeletion(client ccv3.Client, appGuid string, remainingAttempts int)
467466

468467
// error handling
469468
if err != nil {
470-
// https://github.com/cloudfoundry/cloud_controller_ng/issues/3589 -> Delete app when bound to service fails with async service brokers -> Retry that
471-
specialError, _ := regexp.MatchString("An operation for the service binding between app .* and service instance .* is in progress.", err.Error())
472-
if specialError {
473-
if remainingAttempts > 0 {
474-
time.Sleep(5 * time.Second)
475-
return SafeAppDeletion(client, appGuid, remainingAttempts-1)
476-
}
477-
return fmt.Errorf("Retries for app deletion exhausted: %+v", err)
469+
if remainingAttempts > 0 {
470+
time.Sleep(5 * time.Second)
471+
return SafeAppDeletion(client, appGuid, remainingAttempts-1)
478472
}
479-
return err
473+
return fmt.Errorf("Retries for app deletion exhausted: %+v", err)
480474
}
481475

482476
return nil

0 commit comments

Comments
 (0)