Skip to content

Commit

Permalink
update error message for instanceAlreadyExists (#4979) (#9591)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jul 19, 2021
1 parent 8a16fc4 commit 45c0823
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/4979.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
sql: fixed bug where the provider would retry on an error if the database instance name couldn't be reused.
```
2 changes: 1 addition & 1 deletion google/error_retry_predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func isSqlInternalError(err error) (bool, string) {
// concurrent operations.
func isSqlOperationInProgressError(err error) (bool, string) {
if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 409 {
if strings.Contains(gerr.Body, "you cannot reuse the name of the deleted instance until one week from the deletion date.") {
if strings.Contains(gerr.Body, "instanceAlreadyExists") {
return false, ""
}

Expand Down

0 comments on commit 45c0823

Please sign in to comment.