to-disk: Add --bootc-install-podman-arg for extra inner podman args#261
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the --bootc-install-podman-arg flag to the to-disk command, allowing users to pass additional arguments to the underlying podman run process. The implementation ensures shell safety by quoting arguments with shlex and includes a new integration test. Feedback was provided regarding the generation of the bash script template, specifically that an empty set of arguments might result in trailing backslashes or messy formatting in the final script, suggesting a cleaner handling of the empty case.
| let extra_podman_args = self | ||
| .additional | ||
| .bootc_install_podman_args | ||
| .iter() | ||
| .map(|a| { | ||
| shlex::try_quote(a) | ||
| .map(|q| q.to_string()) | ||
| .map_err(|e| eyre!("Failed to quote podman arg '{}': {}", a, e)) | ||
| }) | ||
| .collect::<Result<Vec<_>>>()? | ||
| .join(" "); |
There was a problem hiding this comment.
The logic for building extra_podman_args correctly uses shlex::try_quote for shell safety, which is essential since these arguments are later embedded into a bash script. However, the current implementation results in a string that, when empty, still leaves a trailing backslash in the generated script (e.g., at line 296). While bash handles this, it would be cleaner to handle the empty case explicitly or ensure the template doesn't end up with an empty line continuation.
gursewak1997
left a comment
There was a problem hiding this comment.
Looks decent to me
Adds a repeatable --bootc-install-podman-arg flag that passes additional arguments to the inner `podman run` that executes `bootc install to-disk`. I wanted to test out passing `--read-only` in particular (which we can't make the default just yet...) Assisted-by: OpenCode (claude-sonnet-4-6) Signed-off-by: Colin Walters <walters@verbum.org>
37bffd3 to
1c9ea2f
Compare
Adds a repeatable --bootc-install-podman-arg flag that passes additional arguments to the inner
podman runthat executesbootc install to-disk.I wanted to test out passing
--read-onlyin particular (which we can't make the default just yet...)Assisted-by: OpenCode (claude-sonnet-4-6)