Skip to content

Commit

Permalink
Add new method to instantiate Delete command
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Ros committed Sep 20, 2021
1 parent 3e242b9 commit bd323fd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/commands/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ pub struct Delete {
}

impl Delete {
/// instant Delete Command
///
/// This method is provided for those using `youki` as a library to enable the use of the
/// Delete command to remove containers.
pub fn new(container_id: String, force: bool) -> Self {
Self {
container_id,
force,
}
}

pub fn exec(&self, root_path: PathBuf, systemd_cgroup: bool) -> Result<()> {
log::debug!("start deleting {}", self.container_id);
// state of container is stored in a directory named as container id inside
Expand Down

0 comments on commit bd323fd

Please sign in to comment.