Skip to content

Commit

Permalink
kaps: Add id parameter to run command
Browse files Browse the repository at this point in the history
Introduce a required id parameter to the cli run command.
Add usage of the container state implementation.

Signed-off-by: kalil <[email protected]>
  • Loading branch information
kalil-pelissier authored and sameo committed Apr 23, 2022
1 parent 51c76fa commit 716f943
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ use container::Container;
/// The `handler` method provided below will be executed.
#[derive(Debug, Args)]
pub struct RunCommand {
/// Name of the container instance that will be start. It must me unique on your host
name: String,

/// The bundle used by the container.
#[clap(short, long)]
bundle: String,
Expand All @@ -23,8 +26,8 @@ pub struct RunCommand {
#[async_trait]
impl Handler for RunCommand {
async fn handler(&self, _: &mut env_logger::Builder) -> Result<()> {
// Create a container by passing the bundle provided in arguments to it's constructor.
let container = Container::new(&self.bundle)?;
// Create a container by passing the bundle and the id provided in arguments to it's constructor.
let mut container = Container::new(&self.bundle, &self.name)?;

// Run the container
// At the moment, we don't have a detached mode for the container,
Expand Down

0 comments on commit 716f943

Please sign in to comment.