Skip to content

Commit bd4b055

Browse files
gursewak1997Johan-Liebert1
authored andcommitted
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 <gursmangat@gmail.com>
1 parent 55f0fa5 commit bd4b055

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

crates/kit/src/to_disk.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,15 @@ pub enum RunOutcome {
382382
///
383383
/// Main entry point for the bootc installation process. See module-level documentation
384384
/// for details on the installation workflow and architecture.
385-
pub fn run(opts: ToDiskOpts) -> Result<RunOutcome> {
385+
pub fn run(mut opts: ToDiskOpts) -> Result<RunOutcome> {
386+
// Normalize the source image name by stripping containers-storage: prefix if present.
387+
// The containers-storage: prefix is a transport specifier used by some tools like skopeo,
388+
// but podman commands (image inspect, run --mount=type=image) expect just the image name.
389+
// We'll add it back where needed (e.g., in bootc install commands).
390+
if let Some(stripped) = opts.source_image.strip_prefix("containers-storage:") {
391+
opts.source_image = stripped.to_string();
392+
}
393+
386394
// Phase 0: Check for existing cached disk image
387395
let would_reuse = if opts.target_disk.exists() {
388396
debug!(

0 commit comments

Comments
 (0)