Skip to content

Commit

Permalink
fix: allow volume creation when the _data directory already exists
Browse files Browse the repository at this point in the history
This restores pre f7e72bc behavior

Signed-off-by: Yan Minari <[email protected]>
  • Loading branch information
yangm97 committed Nov 5, 2020
1 parent 4d013ca commit ca7dcff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/runtime_volume_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ca7dcff

Please sign in to comment.