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")) {
|
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 {
|
||||||
|
|||||||
@@ -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, {
|
||||||
|
|||||||
Reference in New Issue
Block a user