Skip to content

Commit

Permalink
features: Add features subcommand
Browse files Browse the repository at this point in the history
The 'features' subcommand is not publicly documented yet, but it was introduced
in `runc` in opencontainers/runc#3296.

Signed-off-by: Christophe de Dinechin <[email protected]>
  • Loading branch information
c3d committed Mar 7, 2023
1 parent 190ce1d commit 173b011
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions crates/liboci-cli/src/features.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use clap::Parser;

/// Return the features list for a container
/// This is not a documented subcommand of runc yet, but it was introduced by
/// https://github.com/opencontainers/runc/pull/3296
#[derive(Parser, Debug)]
pub struct Features {}
6 changes: 4 additions & 2 deletions crates/liboci-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub use {create::Create, delete::Delete, kill::Kill, start::Start, state::State}
mod checkpoint;
mod events;
mod exec;
mod features;
mod list;
mod pause;
mod ps;
Expand All @@ -26,8 +27,8 @@ mod spec;
mod update;

pub use {
checkpoint::Checkpoint, events::Events, exec::Exec, list::List, pause::Pause, ps::Ps,
resume::Resume, run::Run, spec::Spec, update::Update,
checkpoint::Checkpoint, events::Events, exec::Exec, features::Features, list::List,
pause::Pause, ps::Ps, resume::Resume, run::Run, spec::Spec, update::Update,
};

// Subcommands parsed by liboci-cli, based on the [OCI
Expand All @@ -52,6 +53,7 @@ pub enum CommonCmd {
Checkpointt(Checkpoint),
Events(Events),
Exec(Exec),
Features(Features),
List(List),
Pause(Pause),
#[clap(allow_hyphen_values = true)]
Expand Down
8 changes: 8 additions & 0 deletions crates/youki/src/commands/features.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//! Contains Functionality of `features` container command
use anyhow::Result;
use liboci_cli::Features;

/// lists all existing containers
pub fn features(_: Features) -> Result<()> {
Ok(())
}
1 change: 1 addition & 0 deletions crates/youki/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub mod create;
pub mod delete;
pub mod events;
pub mod exec;
pub mod features;
pub mod info;
pub mod kill;
pub mod list;
Expand Down
1 change: 1 addition & 0 deletions crates/youki/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ fn main() -> Result<()> {
std::process::exit(-1);
}
},
CommonCmd::Features(features) => commands::features::features(features),
CommonCmd::List(list) => commands::list::list(list, root_path),
CommonCmd::Pause(pause) => commands::pause::pause(pause, root_path),
CommonCmd::Ps(ps) => commands::ps::ps(ps, root_path),
Expand Down

0 comments on commit 173b011

Please sign in to comment.