Skip to content
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

Man improvements #243

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,49 @@ pub(crate) enum TestingOpts {
#[clap(rename_all = "kebab-case")]
#[allow(clippy::large_enum_variant)]
pub(crate) enum Opt {
/// Look for updates to the booted container image.
/// Download and queue an updated container image to apply.
///
/// This does not affect the running system; updates operate in an "A/B" style by default.
///
/// A queued update is visible as `staged` in `bootc status`.
///
/// Currently by default, the update will be applied at shutdown time via `ostree-finalize-staged.service`.
/// There is also an explicit `bootc upgrade --apply` verb which will automatically take action (rebooting)
/// if the system has changed.
///
/// However, in the future this is likely to change such that reboots outside of a `bootc upgrade --apply`
/// do *not* upgrade.
#[clap(alias = "update")]
Upgrade(UpgradeOpts),
/// Target a new container image reference to boot.
///
/// This operates in a very similar fashion to `upgrade`, but changes the container image reference
/// instead.
Switch(SwitchOpts),
/// Change host specification
/// Apply full changes to the host specification.
///
/// This command operates very similarly to `kubectl apply`; if invoked interactively,
/// then the current host specification will be presented in the system default `$EDITOR`
/// for interactive changes.
///
/// It is also possible to directly provide new contents via `bootc edit --filename`.
///
/// Only changes to the `spec` section are honored.
Edit(EditOpts),
/// Display status
///
/// This will output a YAML-formatted object using a schema intended to match a Kubernetes resource
/// that describes the state of the booted container.
/// that describes the state of the booted system.
///
/// The exact API format is not currently declared stable.
Status(StatusOpts),
/// Add a transient writable overlayfs on `/usr` that will be discarded on reboot.
#[clap(alias = "usroverlay")]
UsrOverlay,
/// Install the running container to a target
/// Install the running container to a target.
///
/// This has two main sub-commands `to-disk` (which expects an empty block device) and `to-filesystem`
/// which supports installation to an already extant filesystem.
#[clap(subcommand)]
#[cfg(feature = "install")]
Install(InstallOpts),
Expand Down
15 changes: 12 additions & 3 deletions manpages-md/bootc-edit.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NAME

bootc-edit - Change host specification
bootc-edit - Apply full changes to the host specification

# SYNOPSIS

Expand All @@ -9,7 +9,16 @@ bootc-edit - Change host specification

# DESCRIPTION

Change host specification
Apply full changes to the host specification.

This command operates very similarly to \`kubectl apply\`; if invoked
interactively, then the current host specification will be presented in
the system default \`\$EDITOR\` for interactive changes.

It is also possible to directly provide new contents via \`bootc edit
\--filename\`.

Only changes to the \`spec\` section are honored.

# OPTIONS

Expand All @@ -23,7 +32,7 @@ Change host specification

**-h**, **\--help**

: Print help
: Print help (see a summary with -h)

**-V**, **\--version**

Expand Down
17 changes: 9 additions & 8 deletions manpages-md/bootc-install-to-disk.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bootc-install-to-disk - Install to the target block device

**bootc-install-to-disk** \[**\--wipe**\] \[**\--block-setup**\]
\[**\--filesystem**\] \[**\--root-size**\] \[**\--target-transport**\]
\[**\--target-imgref**\] \[**\--target-no-signature-verification**\]
\[**\--target-imgref**\] \[**\--enforce-container-sigpolicy**\]
\[**\--target-ostree-remote**\] \[**\--skip-fetch-check**\]
\[**\--disable-selinux**\] \[**\--karg**\] \[**\--generic-image**\]
\[**-h**\|**\--help**\] \[**-V**\|**\--version**\] \<*DEVICE*\>
Expand Down Expand Up @@ -53,9 +53,12 @@ By default, all remaining space on the disk will be used.

: Specify the image to fetch for subsequent updates

**\--target-no-signature-verification**
**\--enforce-container-sigpolicy**

: Explicitly opt-out of requiring any form of signature verification
: This is the inverse of the previous
\`\--target-no-signature-verification\` (which is now a no-op).
Enabling this option enforces that \`/etc/containers/policy.json\`
includes a default policy which requires signatures

**\--target-ostree-remote**=*TARGET_OSTREE_REMOTE*

Expand All @@ -68,11 +71,9 @@ By default, all remaining space on the disk will be used.
suppresses the check; use this when you know the issues it might
find are addressed.

Two main reasons this might fail:

\- Forgetting \`\--target-no-signature-verification\` if needed - Using
a registry which requires authentication, but not embedding the pull
secret in the image.
A common reason this may fail is when one is using an image which
requires registry authentication, but not embedding the pull secret in
the image so that updates can be fetched by the installed OS \"day 2\".

**\--disable-selinux**

Expand Down
23 changes: 12 additions & 11 deletions manpages-md/bootc-install-to-filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ bootc-install-to-filesystem - Install to the target filesystem
**bootc-install-to-filesystem** \[**\--root-mount-spec**\]
\[**\--root-options**\] \[**\--boot-mount-spec**\] \[**\--replace**\]
\[**\--target-transport**\] \[**\--target-imgref**\]
\[**\--target-no-signature-verification**\]
\[**\--target-ostree-remote**\] \[**\--skip-fetch-check**\]
\[**\--disable-selinux**\] \[**\--karg**\] \[**\--generic-image**\]
\[**-h**\|**\--help**\] \[**-V**\|**\--version**\] \<*ROOT_PATH*\>
\[**\--enforce-container-sigpolicy**\] \[**\--target-ostree-remote**\]
\[**\--skip-fetch-check**\] \[**\--disable-selinux**\] \[**\--karg**\]
\[**\--generic-image**\] \[**-h**\|**\--help**\]
\[**-V**\|**\--version**\] \<*ROOT_PATH*\>

# DESCRIPTION

Expand Down Expand Up @@ -62,9 +62,12 @@ be used.

: Specify the image to fetch for subsequent updates

**\--target-no-signature-verification**
**\--enforce-container-sigpolicy**

: Explicitly opt-out of requiring any form of signature verification
: This is the inverse of the previous
\`\--target-no-signature-verification\` (which is now a no-op).
Enabling this option enforces that \`/etc/containers/policy.json\`
includes a default policy which requires signatures

**\--target-ostree-remote**=*TARGET_OSTREE_REMOTE*

Expand All @@ -77,11 +80,9 @@ be used.
suppresses the check; use this when you know the issues it might
find are addressed.

Two main reasons this might fail:

\- Forgetting \`\--target-no-signature-verification\` if needed - Using
a registry which requires authentication, but not embedding the pull
secret in the image.
A common reason this may fail is when one is using an image which
requires registry authentication, but not embedding the pull secret in
the image so that updates can be fetched by the installed OS \"day 2\".

**\--disable-selinux**

Expand Down
8 changes: 6 additions & 2 deletions manpages-md/bootc-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ bootc-install - Install the running container to a target

# DESCRIPTION

Install the running container to a target
Install the running container to a target.

This has two main sub-commands \`to-disk\` (which expects an empty block
device) and \`to-filesystem\` which supports installation to an already
extant filesystem.

# OPTIONS

**-h**, **\--help**

: Print help
: Print help (see a summary with -h)

**-V**, **\--version**

Expand Down
4 changes: 3 additions & 1 deletion manpages-md/bootc-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Display status

This will output a YAML-formatted object using a schema intended to
match a Kubernetes resource that describes the state of the booted
container. The exact API format is not currently declared stable.
system.

The exact API format is not currently declared stable.

# OPTIONS

Expand Down
17 changes: 12 additions & 5 deletions manpages-md/bootc-switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ bootc-switch - Target a new container image reference to boot
# SYNOPSIS

**bootc-switch** \[**\--quiet**\] \[**\--transport**\]
\[**\--no-signature-verification**\] \[**\--ostree-remote**\]
\[**\--enforce-container-sigpolicy**\] \[**\--ostree-remote**\]
\[**\--retain**\] \[**-h**\|**\--help**\] \[**-V**\|**\--version**\]
\<*TARGET*\>

# DESCRIPTION

Target a new container image reference to boot
Target a new container image reference to boot.

This operates in a very similar fashion to \`upgrade\`, but changes the
container image reference instead.

# OPTIONS

Expand All @@ -23,9 +26,13 @@ Target a new container image reference to boot

: The transport; e.g. oci, oci-archive. Defaults to \`registry\`

**\--no-signature-verification**
**\--enforce-container-sigpolicy**

: This is the inverse of the previous
\`\--target-no-signature-verification\` (which is now a no-op).

: Explicitly opt-out of requiring any form of signature verification
Enabling this option enforces that \`/etc/containers/policy.json\`
includes a default policy which requires signatures.

**\--ostree-remote**=*OSTREE_REMOTE*

Expand All @@ -37,7 +44,7 @@ Target a new container image reference to boot

**-h**, **\--help**

: Print help
: Print help (see a summary with -h)

**-V**, **\--version**

Expand Down
17 changes: 15 additions & 2 deletions manpages-md/bootc-upgrade.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NAME

bootc-upgrade - Look for updates to the booted container image
bootc-upgrade - Download and queue an updated container image to apply

# SYNOPSIS

Expand All @@ -10,7 +10,20 @@ bootc-upgrade - Look for updates to the booted container image

# DESCRIPTION

Look for updates to the booted container image
Download and queue an updated container image to apply.

This does not affect the running system; updates operate in an \"A/B\"
style by default.

A queued update is visible as \`staged\` in \`bootc status\`.

Currently by default, the update will be applied at shutdown time via
\`ostree-finalize-staged.service\`. There is also an explicit \`bootc
upgrade \--apply\` verb which will automatically take action (rebooting)
if the system has changed.

However, in the future this is likely to change such that reboots
outside of a \`bootc upgrade \--apply\` do \*not\* upgrade.

# OPTIONS

Expand Down
4 changes: 2 additions & 2 deletions manpages-md/bootc.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ Changes in \`/etc\` and \`/var\` persist.

bootc-upgrade(8)

: Look for updates to the booted container image
: Download and queue an updated container image to apply

bootc-switch(8)

: Target a new container image reference to boot

bootc-edit(8)

: Change host specification
: Apply full changes to the host specification

bootc-status(8)

Expand Down
2 changes: 1 addition & 1 deletion xtask/src/xtask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn man2markdown(sh: &Shell) -> Result<()> {
.file_stem()
.and_then(|name| name.to_str())
.ok_or_else(|| anyhow!("Expected filename in {path:?}"))?;
let target = format!("docs/man/{filename}.md");
let target = format!("manpages-md/{filename}.md");
cmd!(
sh,
"pandoc --from=man --to=markdown --output={target} {path}"
Expand Down