File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
system-reinstall-bootc/src Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ pub(crate) mod users;
11
11
12
12
const ROOT_KEY_MOUNT_POINT : & str = "/bootc_authorized_ssh_keys/root" ;
13
13
14
+ const NO_SSH_PROMPT : & str = "None of the users on this system found have authorized SSH keys, if
15
+ your image doesn't use cloud-init or other means to set up users, you may not be able to log in
16
+ after reinstalling. Do you want to continue?" ;
17
+
14
18
fn run ( ) -> Result < ( ) > {
15
19
bootc_utils:: initialize_tracing ( ) ;
16
20
tracing:: trace!( "starting {}" , env!( "CARGO_PKG_NAME" ) ) ;
@@ -20,8 +24,13 @@ fn run() -> Result<()> {
20
24
21
25
let config = config:: ReinstallConfig :: load ( ) . context ( "loading config" ) ?;
22
26
23
- let mut reinstall_podman_command =
24
- podman:: command ( & config. bootc_image , & prompt:: get_root_key ( ) ?) ;
27
+ let root_key = & prompt:: get_root_key ( ) ?;
28
+
29
+ if root_key. is_none ( ) && !prompt:: ask_yes_no ( NO_SSH_PROMPT , false ) ? {
30
+ return Ok ( ( ) ) ;
31
+ }
32
+
33
+ let mut reinstall_podman_command = podman:: command ( & config. bootc_image , root_key) ;
25
34
26
35
println ! ( ) ;
27
36
You can’t perform that action at this time.
0 commit comments