Skip to content
This repository was archived by the owner on Jun 18, 2022. It is now read-only.

Commit

Permalink
send error back if error has retry
Browse files Browse the repository at this point in the history
  • Loading branch information
Daishan Peng committed Apr 22, 2017
1 parent 04f1a73 commit b928359
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/rancher/agent/utilities/utils"
"golang.org/x/net/context"
"os"
"strings"
"time"
)

Expand Down Expand Up @@ -132,6 +133,9 @@ func DoVolumeRemove(volume model.Volume, storagePool model.StoragePool, progress
for i := 0; i < 3; i++ {
err := dockerClient.VolumeRemove(context.Background(), volume.Name, false)
if err != nil {
if strings.Contains(err.Error(), "Should retry") {
return errors.Wrap(err, constants.DoVolumeRemoveError+"Error removing volume")
}
errorList = append(errorList, err)
} else {
break
Expand Down

0 comments on commit b928359

Please sign in to comment.