mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
fixes: The case on the readonly that the path before doesn't exist, just let it
This commit is contained in:
@@ -55,11 +55,8 @@ pub async fn mount(
|
|||||||
let subpath = subpath.unwrap_or_default();
|
let subpath = subpath.unwrap_or_default();
|
||||||
let subpath = subpath.strip_prefix("/").unwrap_or(&subpath);
|
let subpath = subpath.strip_prefix("/").unwrap_or(&subpath);
|
||||||
let source = data_dir(&context.seed.ctx.datadir, &package_id, &volume_id).join(subpath);
|
let source = data_dir(&context.seed.ctx.datadir, &package_id, &volume_id).join(subpath);
|
||||||
if readonly && tokio::fs::metadata(&source).await.is_err() {
|
if tokio::fs::metadata(&source).await.is_err() {
|
||||||
return Err(Error::new(
|
tokio::fs::create_dir_all(&source).await?;
|
||||||
eyre!("{volume_id}/{} does not exist", subpath.display()),
|
|
||||||
ErrorKind::NotFound,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
let location = location.strip_prefix("/").unwrap_or(&location);
|
let location = location.strip_prefix("/").unwrap_or(&location);
|
||||||
let mountpoint = context
|
let mountpoint = context
|
||||||
|
|||||||
Reference in New Issue
Block a user