-
Notifications
You must be signed in to change notification settings - Fork 172
cli: Only allow some arguments if composefs-backend is true #1990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Currently the cli accepts `--insecure`, `--bootloader`, `--uki-addon` for ostree installs as well, which is not quite right as in the best case scenario they won't do anything and in the worst case scenario they might leave the install in undefined state Also, update the bootloader docs to specify systemd-boot is only available for composefs backend Xref: bootc-dev#1989 Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
4a28be2 to
9dcdc2f
Compare
There was a problem hiding this 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 correctly restricts the --insecure, --bootloader, and --uki-addon CLI arguments to be used only with --composefs-backend. This is a good improvement as it leverages clap's validation capabilities, providing earlier and clearer feedback to the user. The removal of the now-redundant manual validation code simplifies the implementation. The accompanying documentation update is also helpful. I have one minor suggestion to further improve the clarity of the documentation.
| If bootupd is not present in the input container image, then systemd-boot will be used | ||
| by default (except on s390x). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence could be slightly confusing. While it's true that systemd-boot is the fallback if bootupd is not present, for ostree-based installs this will result in an error. It might be clearer to explicitly state that this default behavior applies to composefs installs to avoid any ambiguity.
For example:
For composefs-based installations, if `bootupd` is not present in the input container image, then `systemd-boot` will be used by default (except on s390x).| If bootupd is not present in the input container image, then systemd-boot will be used | |
| by default (except on s390x). | |
| For composefs-based installations, if `bootupd` is not present in the input container image, then systemd-boot will be used | |
| by default (except on s390x). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but not new with this PR
| #[clap(long, default_value_t, requires = "composefs_backend")] | ||
| #[serde(default)] | ||
| pub(crate) insecure: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're here...(not part of this PR but as followup) I would like to propose renaming this to something like --allow-missing-fsverity or something.
|
|
||
| ## systemd-boot | ||
|
|
||
| NOTE: systemd-boot is only supported for Composefs Backend and not for Ostree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just
systemd-boot is only supported by the composefs backend, and not the (default) ostree backend.
| If bootupd is not present in the input container image, then systemd-boot will be used | ||
| by default (except on s390x). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but not new with this PR
| #[context("Installing to disk")] | ||
| #[cfg(feature = "install-to-disk")] | ||
| pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> { | ||
| opts.validate()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this, however I think we could easily change this to be anyhow::ensure!() instead - yes it's double checking but probably worth doing.
Currently the cli accepts
--insecure,--bootloader,--uki-addonfor ostree installs as well, which is not quite right as in the best case scenario they won't do anything and in the worst case scenario they might leave the install in undefined stateAlso, update the bootloader docs to specify systemd-boot is only
available for composefs backend
Xref: #1989