Skip to content

Commit

Permalink
Merge pull request #2964 from YJDoc2/fix/issue-974
Browse files Browse the repository at this point in the history
print "unknown" instead of defaults if we cannot get kernel config
  • Loading branch information
YJDoc2 authored Oct 28, 2024
2 parents 4077c5d + 860fba6 commit 6cee446
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 6cee446

Please sign in to comment.