From 79dbbdf6b4d91f4c5ca0ec32912008ee892e0a7a Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Fri, 11 Apr 2025 13:03:25 -0600 Subject: [PATCH] fix mounts for pre-existing subcontainers (#2870) * fix mounts for pre-existing subcontainers * don't error on missing assets --- core/startos/src/s9pk/v2/manifest.rs | 4 ++- sdk/package/lib/mainFn/CommandController.ts | 27 ++++++++------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/core/startos/src/s9pk/v2/manifest.rs b/core/startos/src/s9pk/v2/manifest.rs index 6b3b11bd9..609204e43 100644 --- a/core/startos/src/s9pk/v2/manifest.rs +++ b/core/startos/src/s9pk/v2/manifest.rs @@ -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 { diff --git a/sdk/package/lib/mainFn/CommandController.ts b/sdk/package/lib/mainFn/CommandController.ts index 23f798404..fbbeb9e63 100644 --- a/sdk/package/lib/mainFn/CommandController.ts +++ b/sdk/package/lib/mainFn/CommandController.ts @@ -22,7 +22,7 @@ export class CommandController extends Drop { super() } static of() { - return async ( + 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, {