From ca7dcff5a8b3506ab9f343eec9924536724da50a Mon Sep 17 00:00:00 2001 From: Yan Minari Date: Thu, 5 Nov 2020 17:09:12 -0300 Subject: fix: allow volume creation when the _data directory already exists This restores pre f7e72bc86aff2ff986290f190309deceb7f22099 behavior Signed-off-by: Yan Minari --- libpod/runtime_volume_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod') 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 { -- cgit v1.2.3-54-g00ecf