Skip to content

Conversation

@mvo5
Copy link
Contributor

@mvo5 mvo5 commented Dec 2, 2025

When install print-configuration is run some options (notably the kargs) are currently filtered out. This makes sense because in general bootc install to-filesystem takes care of them.

However with the recent work in image-builder/osbuild to use bootc containers directly as inputs to build ISOs [0],[1] we would like to get access to the kernel args too because when constructing a bootable ISO we also want to add the bootc container kargs.

[0] https://github.com/orgs/osbuild/discussions/45
[1] osbuild/images#1906

When `install print-configuration` is run some options (notably
the kargs) are currently filtered out. This makes sense because
in general `bootc install to-filesystem` takes care of them.

However with the recent work in image-builder/osbuild to use
bootc containers directly as inputs to build ISOs [0],[1]
we would like to get access to the kernel args too because
when constructing a bootable ISO we also want to add the
bootc container kargs.

[0] https://github.com/orgs/osbuild/discussions/45
[1] osbuild/images#1906
@github-actions github-actions bot added the area/install Issues related to `bootc install` label Dec 2, 2025
@bootc-bot bootc-bot bot requested a review from jmarrero December 2, 2025 12:24
Copy link
Contributor

@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 an --all flag to the install print-configuration command, allowing it to output all configuration options, including those usually filtered out like kernel arguments. The changes are well-implemented and straightforward. My main feedback is to suggest adding a unit test to ensure the new flag is parsed correctly, which will help with future maintenance.

/// At the current time, the only output key is `root-fs-type` which is a string-valued
/// filesystem name suitable for passing to `mkfs.$type`.
PrintConfiguration,
PrintConfiguration(crate::install::InstallPrintConfigurationOpts),
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While the change itself is correct, it would be beneficial to add a unit test to verify the parsing of the new --all flag for the install print-configuration subcommand. This ensures future changes don't accidentally break this functionality.

You could add a new test function in the tests module of this file, similar to test_parse_install_args. For example:

#[test]
fn test_parse_print_configuration() {
    // Default, no --all
    let o = Opt::try_parse_from(["bootc", "install", "print-configuration"]).unwrap();
    let o = match o {
        Opt::Install(InstallOpts::PrintConfiguration(opts)) => opts,
        o => panic!("Expected print-configuration opts, not {o:?}"),
    };
    assert!(!o.all);

    // With --all
    let o = Opt::try_parse_from(["bootc", "install", "print-configuration", "--all"]).unwrap();
    let o = match o {
        Opt::Install(InstallOpts::PrintConfiguration(opts)) => opts,
        o => panic!("Expected print-configuration opts, not {o:?}"),
    };
    assert!(o.all);
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Tests are good, but we can't really do this in unit tests because it operates on ambient data.

We can do it in tests-integration/src/container.rs though I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install Issues related to `bootc install`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants