diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-11-06 01:28:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 01:28:42 +0100 |
commit | f1be2dcbfc413503a28368910666871218f97457 (patch) | |
tree | 469dd8f894c7821e4a9cb1be6e46729a841ea995 | |
parent | 14d18deb94baf582c87a7a2fb2c259208204c39c (diff) | |
parent | ca7dcff5a8b3506ab9f343eec9924536724da50a (diff) | |
download | podman-f1be2dcbfc413503a28368910666871218f97457.tar.gz podman-f1be2dcbfc413503a28368910666871218f97457.tar.bz2 podman-f1be2dcbfc413503a28368910666871218f97457.zip |
Merge pull request #8254 from yangm97/adopt-existing-volumes
fix: allow volume creation when the _data directory already exists
-rw-r--r-- | libpod/runtime_volume_linux.go | 2 |
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 { |