Skip to content

Commit

Permalink
fix(compose): .build Quadlet file error reporting
Browse files Browse the repository at this point in the history
If there was an error converting the `build` section of a Compose
service it would not be reported to the user. The rest of the service
would fail to convert to a `.container` Quadlet file as the `image`
would not be set (it's set after the `build` section is successfully
converted). The user would receive a "`image` or `build` is required"
error as the service error would be reported first.

Changed `podlet::cli::compose::services_try_into_quadlet_files()` so
that if an error occurs when converting the `build` section, it is
reported to the user without attempting to convert the rest of the
service.

Fixes: #126
Signed-off-by: Paul Nettleton <[email protected]>
  • Loading branch information
k9withabone committed Oct 26, 2024
1 parent f313850 commit 79cd688
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cli/compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ fn services_try_into_quadlet_files<'a>(
install: install.cloned(),
})
});
if let Some(result @ Err(_)) = build {
return iter::once(result).chain(None);
}

let container = service_try_into_quadlet_file(
service,
Expand Down

0 comments on commit 79cd688

Please sign in to comment.