summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan Minari <yangm97@gmail.com>2020-11-05 17:09:12 -0300
committerYan Minari <yangm97@gmail.com>2020-11-05 17:09:12 -0300
commitca7dcff5a8b3506ab9f343eec9924536724da50a (patch)
tree8cee1e6633687d24f9742d3a0e73f6408b696c71
parent4d013caffcb0088e589ab65bc01208d53a71f922 (diff)
downloadpodman-ca7dcff5a8b3506ab9f343eec9924536724da50a.tar.gz
podman-ca7dcff5a8b3506ab9f343eec9924536724da50a.tar.bz2
podman-ca7dcff5a8b3506ab9f343eec9924536724da50a.zip
fix: allow volume creation when the _data directory already exists
This restores pre f7e72bc86aff2ff986290f190309deceb7f22099 behavior Signed-off-by: Yan Minari <yangm97@gmail.com>
-rw-r--r--libpod/runtime_volume_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime_volume_linux.go b/libpod/runtime_volume_linux.go
index 32fb1ef44..e1877b17d 100644
--- a/libpod/runtime_volume_linux.go
+++ b/libpod/runtime_volume_linux.go
@@ -75,7 +75,7 @@ func (r *Runtime) newVolume(ctx context.Context, options ...VolumeCreateOption)
return nil, errors.Wrapf(err, "error chowning volume directory %q to %d:%d", volPathRoot, volume.config.UID, volume.config.GID)
}
fullVolPath := filepath.Join(volPathRoot, "_data")
- if err := os.Mkdir(fullVolPath, 0755); err != nil {
+ if err := os.MkdirAll(fullVolPath, 0755); err != nil {
return nil, errors.Wrapf(err, "error creating volume directory %q", fullVolPath)
}
if err := os.Chown(fullVolPath, volume.config.UID, volume.config.GID); err != nil {