Skip to content

Commit 1f799f9

Browse files
committed
run: Fail explicitly if catatonit not found
Signed-off-by: Alexander Larsson <alexl@redhat.com>
1 parent bbdcef6 commit 1f799f9

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

composefs-run/src/run.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -631,14 +631,10 @@ fn build_runtime_spec(
631631

632632
let use_init = !cli.no_init && !systemd_mode;
633633
let init_path = if use_init {
634-
match find_catatonit() {
635-
Ok(path) => {
636-
args.insert(0, "/dev/init".into());
637-
args.insert(1, "--".into());
638-
Some(path)
639-
}
640-
Err(_) => None,
641-
}
634+
let path = find_catatonit().context("catatonit is required (use --no-init to disable)")?;
635+
args.insert(0, "/dev/init".into());
636+
args.insert(1, "--".into());
637+
Some(path)
642638
} else {
643639
None
644640
};

0 commit comments

Comments
 (0)