Skip to content

Commit

Permalink
Merge pull request #91 from utam0k/unknown-controller
Browse files Browse the repository at this point in the history
make sure to log any unimplemented controllers.
  • Loading branch information
Furisto authored Jun 16, 2021
2 parents 2f14718 + 9ac8f36 commit 8c50c76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cgroups/v2/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
path::{Path, PathBuf},
};

use anyhow::{anyhow, Result};
use anyhow::{bail, Result};

use nix::unistd::Pid;
use oci_spec::LinuxResources;
Expand Down Expand Up @@ -80,10 +80,10 @@ impl Manager {
) -> Result<Vec<ControllerType>> {
let controllers_path = self.root_path.join(cgroup_path).join(CGROUP_CONTROLLERS);
if !controllers_path.exists() {
return Err(anyhow!(
bail!(
"cannot get available controllers. {:?} does not exist",
controllers_path
));
)
}

let mut controllers = Vec::new();
Expand All @@ -95,7 +95,7 @@ impl Manager {
"io" => controllers.push(ControllerType::Io),
"memory" => controllers.push(ControllerType::Memory),
"pids" => controllers.push(ControllerType::Pids),
_ => continue,
tpe => log::warn!("Controller {} is not yet implemented.", tpe),
}
}

Expand Down

0 comments on commit 8c50c76

Please sign in to comment.