Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
/ porto Public archive

Commit

Permalink
fix(volume): create volume directory if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota authored and ernado committed Jan 29, 2024
1 parent 436d299 commit c8d1090
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/volume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4354,6 +4354,12 @@ TError TVolume::Create(const rpc::TVolumeSpec &spec,
if (Volumes.count(path))
return TError(EError::VolumeAlreadyExists, "Volume already exists");

if (!path.Exists()) {
error = path.MkdirAll(0755);
if (error)
return error;
}

TFile path_dir;
error = path_dir.OpenPath(path);
if (error)
Expand Down

0 comments on commit c8d1090

Please sign in to comment.