-
Notifications
You must be signed in to change notification settings - Fork 174
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -383,18 +383,18 @@ pub(crate) struct InstallComposefsOpts { | |
| pub(crate) composefs_backend: bool, | ||
|
|
||
| /// Make fs-verity validation optional in case the filesystem doesn't support it | ||
| #[clap(long, default_value_t)] | ||
| #[clap(long, default_value_t, requires = "composefs_backend")] | ||
| #[serde(default)] | ||
| pub(crate) insecure: bool, | ||
|
|
||
| /// The bootloader to use. | ||
| #[clap(long)] | ||
| #[clap(long, requires = "composefs_backend")] | ||
| #[serde(default)] | ||
| pub(crate) bootloader: Option<Bootloader>, | ||
|
|
||
| /// Name of the UKI addons to install without the ".efi.addon" suffix. | ||
| /// This option can be provided multiple times if multiple addons are to be installed. | ||
| #[clap(long)] | ||
| #[clap(long, requires = "composefs_backend")] | ||
| #[serde(default)] | ||
| pub(crate) uki_addon: Option<Vec<String>>, | ||
| } | ||
|
|
@@ -804,20 +804,6 @@ impl FromStr for MountSpec { | |
| } | ||
| } | ||
|
|
||
| #[cfg(feature = "install-to-disk")] | ||
| impl InstallToDiskOpts { | ||
| pub(crate) fn validate(&self) -> Result<()> { | ||
| if !self.composefs_opts.composefs_backend { | ||
| // Reject using --insecure without --composefs-backend | ||
| if self.composefs_opts.insecure != false { | ||
| anyhow::bail!("--insecure must not be provided without --composefs-backend"); | ||
| } | ||
| } | ||
|
|
||
| Ok(()) | ||
| } | ||
| } | ||
|
|
||
| impl SourceInfo { | ||
| // Inspect container information and convert it to an ostree image reference | ||
| // that pulls from containers-storage. | ||
|
|
@@ -1928,8 +1914,6 @@ fn installation_complete() { | |
| #[context("Installing to disk")] | ||
| #[cfg(feature = "install-to-disk")] | ||
| pub(crate) async fn install_to_disk(mut opts: InstallToDiskOpts) -> Result<()> { | ||
| opts.validate()?; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In agreement. The error that clap provides when passing, say imo, we'd want it so say something like |
||
|
|
||
| // Log the disk installation operation to systemd journal | ||
| const INSTALL_DISK_JOURNAL_ID: &str = "8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2"; | ||
| let source_image = opts | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,8 @@ Currently, `bootc` only runs `bootupd` during the installation process. It does | |||||||||
|
|
||||||||||
| ## systemd-boot | ||||||||||
|
|
||||||||||
| NOTE: systemd-boot is only supported for Composefs Backend and not for Ostree | ||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about just
|
||||||||||
|
|
||||||||||
| If bootupd is not present in the input container image, then systemd-boot will be used | ||||||||||
| by default (except on s390x). | ||||||||||
|
Comment on lines
18
to
19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sentence could be slightly confusing. While it's true that 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).
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, but not new with this PR |
||||||||||
|
|
||||||||||
|
|
||||||||||
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-fsverityor something.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.
Sounds good. I'll update this when finishing up #1913 (comment)