diff --git a/system-reinstall-bootc/src/main.rs b/system-reinstall-bootc/src/main.rs index fd069fcd..8c2233c5 100644 --- a/system-reinstall-bootc/src/main.rs +++ b/system-reinstall-bootc/src/main.rs @@ -11,6 +11,10 @@ pub(crate) mod users; const ROOT_KEY_MOUNT_POINT: &str = "/bootc_authorized_ssh_keys/root"; +const NO_SSH_PROMPT: &str = "None of the users on this system found have authorized SSH keys, if +your image doesn't use cloud-init or other means to set up users, you may not be able to log in +after reinstalling. Do you want to continue?"; + fn run() -> Result<()> { bootc_utils::initialize_tracing(); tracing::trace!("starting {}", env!("CARGO_PKG_NAME")); @@ -20,8 +24,13 @@ fn run() -> Result<()> { let config = config::ReinstallConfig::load().context("loading config")?; - let mut reinstall_podman_command = - podman::command(&config.bootc_image, &prompt::get_root_key()?); + let root_key = &prompt::get_root_key()?; + + if root_key.is_none() && !prompt::ask_yes_no(NO_SSH_PROMPT, false)? { + return Ok(()); + } + + let mut reinstall_podman_command = podman::command(&config.bootc_image, root_key); println!();