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

safe app deletion always retry on any error #567

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
13 changes: 4 additions & 9 deletions cloudfoundry/managers/v3appdeployers/bluegreen_strategy_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,16 +467,11 @@ func SafeAppDeletion(client ccv3.Client, appGuid string, remainingAttempts int)

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

return nil
Expand Down