Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print "unknown" instead of defaults if we cannot get kernel config #2964

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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