From 8162bc91c2b2c5513cc72eb1f82ac91889a78e31 Mon Sep 17 00:00:00 2001 From: gursewak1997 Date: Tue, 28 Apr 2026 16:55:28 -0700 Subject: [PATCH] to-disk: Fix containers-storage prefix duplication When bcvk to-disk was called with a containers-storage: prefixed image reference, it would duplicate the prefix resulting in 'containers-storage:containers-storage:...' which caused the bootc install to fail with 'invalid reference format'. Strip the containers-storage: prefix if present before adding it back, ensuring both prefixed and unprefixed inputs normalize to the same format. Signed-off-by: gursewak1997 --- crates/kit/src/to_disk.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/kit/src/to_disk.rs b/crates/kit/src/to_disk.rs index 24a3066..51e6f1e 100644 --- a/crates/kit/src/to_disk.rs +++ b/crates/kit/src/to_disk.rs @@ -382,7 +382,15 @@ pub enum RunOutcome { /// /// Main entry point for the bootc installation process. See module-level documentation /// for details on the installation workflow and architecture. -pub fn run(opts: ToDiskOpts) -> Result { +pub fn run(mut opts: ToDiskOpts) -> Result { + // Normalize the source image name by stripping containers-storage: prefix if present. + // The containers-storage: prefix is a transport specifier used by some tools like skopeo, + // but podman commands (image inspect, run --mount=type=image) expect just the image name. + // We'll add it back where needed (e.g., in bootc install commands). + if let Some(stripped) = opts.source_image.strip_prefix("containers-storage:") { + opts.source_image = stripped.to_string(); + } + // Phase 0: Check for existing cached disk image let would_reuse = if opts.target_disk.exists() { debug!(