From 6d27399dfb6193c88616ab9b03b8bb9bf2e9fc8e Mon Sep 17 00:00:00 2001 From: HarshwardhanPatil07 Date: Tue, 18 Aug 2026 11:27:15 +0530 Subject: [PATCH] podstorage: Add early check for missing podman binary When podman is not installed, CStorage::create() fails with "No such file or directory (os error 2)" from the underlying Command::new() call, which users misinterpret as a missing file or directory on disk. Add an early have_executable() check that bails with a clear message naming the missing binary, following the same pattern used by ukify.rs. Closes: https://github.com/bootc-dev/bootc/issues/2284 Assisted-by: AI Signed-off-by: HarshwardhanPatil07 --- crates/lib/src/podstorage.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/lib/src/podstorage.rs b/crates/lib/src/podstorage.rs index de6c418ede..8e51a7b38e 100644 --- a/crates/lib/src/podstorage.rs +++ b/crates/lib/src/podstorage.rs @@ -290,6 +290,14 @@ impl CStorage { sepolicy: Option<&ostree::SePolicy>, ) -> Result { Self::init_globals()?; + + let bin = bootc_utils::podman_bin(); + if !crate::utils::have_executable(bin)? { + anyhow::bail!( + "{bin} executable not found in PATH; it is required for container image storage operations" + ); + } + let subpath = &Self::subpath(); // SAFETY: We know there's a parent