Skip to content

Commit 79cd688

Browse files
committed
fix(compose): .build Quadlet file error reporting
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]>
1 parent f313850 commit 79cd688

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cli/compose.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ fn services_try_into_quadlet_files<'a>(
347347
install: install.cloned(),
348348
})
349349
});
350+
if let Some(result @ Err(_)) = build {
351+
return iter::once(result).chain(None);
352+
}
350353

351354
let container = service_try_into_quadlet_file(
352355
service,

0 commit comments

Comments
 (0)