Skip to content

Commit

Permalink
Merge pull request #24 from johscheuer/make-create-idempotent
Browse files Browse the repository at this point in the history
Make create calls idempotent
  • Loading branch information
johscheuer authored Feb 28, 2017
2 parents 699b2f6 + 5e3e596 commit b9677b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion quobyte_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"log"
"os"
"path/filepath"
"strings"
"sync"

"github.com/docker/go-plugins-helpers/volume"
Expand Down Expand Up @@ -49,7 +50,10 @@ func (driver quobyteDriver) Create(request volume.Request) volume.Response {
RootGroupID: group,
}); err != nil {
log.Println(err)
return volume.Response{Err: err.Error()}

if !strings.Contains(err.Error(), "ENTITY_EXISTS_ALREADY/POSIX_ERROR_NONE") {
return volume.Response{Err: err.Error()}
}
}

return volume.Response{Err: ""}
Expand Down

0 comments on commit b9677b9

Please sign in to comment.