Skip to content

Commit d999b79

Browse files
committed
system-reinstall-bootc: add progress indication during install steps
Signed-off-by: Juan <1766933+judavi@users.noreply.github.com>
1 parent 36c665d commit d999b79

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/system-reinstall-bootc/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ tempfile = { workspace = true }
3232
tracing = { workspace = true }
3333
uzers = { workspace = true }
3434

35+
# Workspace dependencies (additional)
36+
indicatif = { workspace = true }
37+
3538
# Crate-specific dependencies
3639
crossterm = "0.29.0"
3740
dialoguer = "0.12.0"

crates/system-reinstall-bootc/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ fn run() -> Result<()> {
8585

8686
prompt::temporary_developer_protection_prompt()?;
8787

88+
println!("Starting bootc installation. This may take several minutes...");
89+
println!();
90+
8891
reinstall_podman_command
8992
.run_inherited_with_cmd_context()
9093
.context("running reinstall command")?;

crates/system-reinstall-bootc/src/podman.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use super::ROOT_KEY_MOUNT_POINT;
44
use anyhow::{Context, Result, ensure};
55
use bootc_utils::CommandRunExt;
66
use fn_error_context::context;
7+
use std::time::Duration;
78
use std::process::Command;
89
use which::which;
910

@@ -80,7 +81,17 @@ pub(crate) fn reinstall_command(opts: &ReinstallOpts, ssh_key_file: &str) -> Res
8081
// bootc system for the first time.
8182
// This only happens if the bootc version in the image >= 1.1.8 (this is when the cleanup
8283
// feature was introduced)
83-
if bootc_has_clean(&opts.image)? {
84+
let spinner = indicatif::ProgressBar::new_spinner();
85+
spinner.set_style(
86+
indicatif::ProgressStyle::default_spinner()
87+
.template("{spinner} {msg}")
88+
.unwrap(),
89+
);
90+
spinner.set_message("Checking image capabilities...");
91+
spinner.enable_steady_tick(Duration::from_millis(150));
92+
let has_clean = bootc_has_clean(&opts.image)?;
93+
spinner.finish_and_clear();
94+
if has_clean {
8495
bootc_command_and_args.push("--cleanup".to_string());
8596
}
8697

@@ -172,4 +183,4 @@ pub(crate) fn ensure_podman_installed() -> Result<()> {
172183
);
173184

174185
Ok(())
175-
}
186+
}

0 commit comments

Comments
 (0)