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

Forbid empty string values for container id in commands #305

Merged
merged 1 commit into from
Sep 18, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct Create {
#[clap(long, default_value = "0")]
preserve_fds: i32,
/// name of the container instance to be started
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
}

Expand Down
1 change: 1 addition & 0 deletions src/commands/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use nix::sys::signal as nix_signal;

#[derive(Clap, Debug)]
pub struct Delete {
#[clap(forbid_empty_values = true, required = true)]
container_id: String,
/// forces deletion of the container if it is still running (using SIGKILL)
#[clap(short, long)]
Expand Down
1 change: 1 addition & 0 deletions src/commands/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct Events {
#[clap(long)]
pub stats: bool,
/// Name of the container instance
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
}

Expand Down
1 change: 1 addition & 0 deletions src/commands/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub struct Exec {
#[clap(short, long)]
pub detach: bool,
/// Identifier of the container
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
/// Command that should be executed in the container
#[clap(required = false)]
Expand Down
1 change: 1 addition & 0 deletions src/commands/kill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::{

#[derive(Clap, Debug)]
pub struct Kill {
#[clap(forbid_empty_values = true, required = true)]
container_id: String,
signal: String,
}
Expand Down
1 change: 1 addition & 0 deletions src/commands/pause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use cgroups::common::FreezerState;
/// Structure to implement pause command
#[derive(Clap, Debug)]
pub struct Pause {
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
}

Expand Down
1 change: 1 addition & 0 deletions src/commands/ps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub struct Ps {
/// format to display processes: table or json (default: "table")
#[clap(short, long, default_value = "table")]
format: String,
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
/// options will be passed to the ps utility
#[clap(setting = clap::ArgSettings::Last)]
Expand Down
1 change: 1 addition & 0 deletions src/commands/resume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use cgroups::common::FreezerState;
/// Structure to implement resume command
#[derive(Clap, Debug)]
pub struct Resume {
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
}

Expand Down
1 change: 1 addition & 0 deletions src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct Run {
#[clap(long, default_value = "0")]
preserve_fds: i32,
/// name of the container instance to be started
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
}

Expand Down
1 change: 1 addition & 0 deletions src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::notify_socket::{NotifySocket, NOTIFY_FILE};

#[derive(Clap, Debug)]
pub struct Start {
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
}

Expand Down
1 change: 1 addition & 0 deletions src/commands/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::container::Container;

#[derive(Clap, Debug)]
pub struct State {
#[clap(forbid_empty_values = true, required = true)]
pub container_id: String,
}

Expand Down