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:
parent
56972bf915
commit
63f01733b0
3 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue