Update snapshot mkdir to check for directory exist

When starting up a snapshot driver on subsequent runs, the
mkdir call will return an exist error, this can be safely
ignored.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2017-04-05 17:04:44 -07:00
parent 56972bf915
commit 63f01733b0
No known key found for this signature in database
GPG key ID: F58C5D0A4405ACDB
3 changed files with 7 additions and 3 deletions

View file

@ -49,7 +49,7 @@ func NewSnapshotter(root string) (snapshot.Snapshotter, error) {
return nil, err
}
if err := os.MkdirAll(filepath.Join(root, "snapshots"), 0700); err != nil {
if err := os.Mkdir(filepath.Join(root, "snapshots"), 0700); err != nil && !os.IsExist(err) {
return nil, err
}