Skip to content

Commit

Permalink
fixup! Support feature subcommand
Browse files Browse the repository at this point in the history
Signed-off-by: Kotaro Inoue <[email protected]>
  • Loading branch information
musaprg committed Oct 3, 2024
1 parent 1898fdb commit b8f902a
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions crates/youki/src/commands/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -11,16 +10,7 @@ use liboci_cli::Features;

// Function to query and return capabilities
fn query_caps() -> Result<Vec<String>> {
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
Expand Down

0 comments on commit b8f902a

Please sign in to comment.