Skip to content

to-disk: Add --bootc-install-podman-arg for extra inner podman args#261

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
cgwalters:bootc-install-podman-args
May 9, 2026
Merged

to-disk: Add --bootc-install-podman-arg for extra inner podman args#261
cgwalters merged 1 commit into
bootc-dev:mainfrom
cgwalters:bootc-install-podman-args

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

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)

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/kit/src/to_disk.rs
Comment on lines +235 to +245
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(" ");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
gursewak1997 previously approved these changes May 8, 2026
Copy link
Copy Markdown
Collaborator

@gursewak1997 gursewak1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks decent to me

Comment thread crates/kit/src/to_disk.rs
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>
@cgwalters cgwalters merged commit 87aa093 into bootc-dev:main May 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants