From b8f902a937f309ab5d41c5fa8be72c4c4548af9c Mon Sep 17 00:00:00 2001 From: Kotaro Inoue Date: Fri, 4 Oct 2024 01:06:30 +0900 Subject: [PATCH] fixup! Support feature subcommand Signed-off-by: Kotaro Inoue --- crates/youki/src/commands/features.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crates/youki/src/commands/features.rs b/crates/youki/src/commands/features.rs index 7335d26a7..e30a0a4be 100644 --- a/crates/youki/src/commands/features.rs +++ b/crates/youki/src/commands/features.rs @@ -2,7 +2,6 @@ use std::path::Path; use anyhow::Result; -use caps::CapSet; use libcontainer::oci_spec::runtime::{ version, ApparmorBuilder, CgroupBuilder, FeaturesBuilder, IDMapBuilder, IntelRdtBuilder, LinuxFeatureBuilder, LinuxNamespaceType, MountExtensionsBuilder, SelinuxBuilder, @@ -11,16 +10,7 @@ use liboci_cli::Features; // Function to query and return capabilities fn query_caps() -> Result> { - let mut available_caps = Vec::new(); - - for cap in caps::all() { - // Check if the capability is in the permitted set - if caps::has_cap(None, CapSet::Permitted, cap).unwrap_or(false) { - available_caps.push(format!("{:?}", cap)); - } - } - - Ok(available_caps) + Ok(caps::all().iter().map(|cap| format!("{:?}", cap)).collect()) } // Function to query and return namespaces