Skip to content

Commit

Permalink
print "unknown" instead of defaults if we cannot get kernel config
Browse files Browse the repository at this point in the history
Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
  • Loading branch information
YJDoc2 committed Oct 28, 2024
1 parent 4077c5d commit 860fba6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/youki/src/commands/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ pub fn print_os() {
println!("{:<18}{}", "Operating System", os);
} else if let Some(os) = try_read_os_from("/usr/lib/os-release") {
println!("{:<18}{}", "Operating System", os);
} else {
println!("{:<18}UNKNOWN", "Operating System");
}
}

Expand Down Expand Up @@ -204,6 +206,9 @@ pub fn print_namespaces() {
println!("{:<18}disabled", "Namespaces");
return;
}
} else {
println!("{:<18}UNKNOWN", "Namespaces");
// we don't return as we can atleast try and see if anything is enabled
}

// mount namespace is always enabled if namespaces are enabled
Expand Down Expand Up @@ -266,7 +271,7 @@ fn print_feature_status(config: &str, feature: &str, display: FeatureDisplay) {

println!(" {:<16}{}", display.name, status);
} else {
println!(" {:<16}{}", display.name, display.disabled);
println!(" {:<16}UNKNOWN", display.name);
}
}

Expand Down

0 comments on commit 860fba6

Please sign in to comment.