mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix mounts for pre-existing subcontainers (#2870)
* fix mounts for pre-existing subcontainers * don't error on missing assets
This commit is contained in:
@@ -95,7 +95,9 @@ impl Manifest {
|
||||
if let Err(e) = expected.check_file(Path::new("assets.squashfs")) {
|
||||
// backwards compatibility for alpha s9pks - remove eventually
|
||||
if expected.check_dir("assets").is_err() {
|
||||
return Err(e);
|
||||
tracing::warn!("{e}");
|
||||
tracing::debug!("{e:?}");
|
||||
// return Err(e);
|
||||
}
|
||||
}
|
||||
for (image_id, config) in &self.images {
|
||||
|
||||
@@ -22,7 +22,7 @@ export class CommandController extends Drop {
|
||||
super()
|
||||
}
|
||||
static of<Manifest extends T.SDKManifest>() {
|
||||
return async <A extends string>(
|
||||
return async (
|
||||
effects: T.Effects,
|
||||
subcontainer:
|
||||
| {
|
||||
@@ -62,24 +62,17 @@ export class CommandController extends Drop {
|
||||
const subc =
|
||||
subcontainer instanceof SubContainer
|
||||
? subcontainer
|
||||
: await (async () => {
|
||||
const subc = await SubContainer.of(
|
||||
effects,
|
||||
subcontainer,
|
||||
options?.subcontainerName || commands.join(" "),
|
||||
)
|
||||
try {
|
||||
for (let mount of options.mounts || []) {
|
||||
await subc.mount(mount.options, mount.mountpoint)
|
||||
}
|
||||
return subc
|
||||
} catch (e) {
|
||||
await subc.destroy()
|
||||
throw e
|
||||
}
|
||||
})()
|
||||
: await SubContainer.of(
|
||||
effects,
|
||||
subcontainer,
|
||||
options?.subcontainerName || commands.join(" "),
|
||||
)
|
||||
|
||||
try {
|
||||
for (let mount of options.mounts || []) {
|
||||
await subc.mount(mount.options, mount.mountpoint)
|
||||
}
|
||||
|
||||
let childProcess: cp.ChildProcess
|
||||
if (options.runAsInit) {
|
||||
childProcess = await subc.launch(commands, {
|
||||
|
||||
Reference in New Issue
Block a user