fix mounts for pre-existing subcontainers (#2870)

* fix mounts for pre-existing subcontainers

* don't error on missing assets
This commit is contained in:
Aiden McClelland
2025-04-11 13:03:25 -06:00
committed by GitHub
parent 20d3b5288c
commit 79dbbdf6b4
2 changed files with 13 additions and 18 deletions

View File

@@ -95,7 +95,9 @@ impl Manifest {
if let Err(e) = expected.check_file(Path::new("assets.squashfs")) { if let Err(e) = expected.check_file(Path::new("assets.squashfs")) {
// backwards compatibility for alpha s9pks - remove eventually // backwards compatibility for alpha s9pks - remove eventually
if expected.check_dir("assets").is_err() { 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 { for (image_id, config) in &self.images {

View File

@@ -22,7 +22,7 @@ export class CommandController extends Drop {
super() super()
} }
static of<Manifest extends T.SDKManifest>() { static of<Manifest extends T.SDKManifest>() {
return async <A extends string>( return async (
effects: T.Effects, effects: T.Effects,
subcontainer: subcontainer:
| { | {
@@ -62,24 +62,17 @@ export class CommandController extends Drop {
const subc = const subc =
subcontainer instanceof SubContainer subcontainer instanceof SubContainer
? subcontainer ? subcontainer
: await (async () => { : await SubContainer.of(
const subc = await SubContainer.of(
effects, effects,
subcontainer, subcontainer,
options?.subcontainerName || commands.join(" "), options?.subcontainerName || commands.join(" "),
) )
try { try {
for (let mount of options.mounts || []) { for (let mount of options.mounts || []) {
await subc.mount(mount.options, mount.mountpoint) await subc.mount(mount.options, mount.mountpoint)
} }
return subc
} catch (e) {
await subc.destroy()
throw e
}
})()
try {
let childProcess: cp.ChildProcess let childProcess: cp.ChildProcess
if (options.runAsInit) { if (options.runAsInit) {
childProcess = await subc.launch(commands, { childProcess = await subc.launch(commands, {