Skip to content

Commit

Permalink
Merge pull request #1793 from utam0k/spec-version-validate
Browse files Browse the repository at this point in the history
Update version check in validate_spec to support 1.X.Y version.
  • Loading branch information
utam0k committed Apr 9, 2023
2 parents cb1340f + 7104494 commit edd63c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions crates/libcontainer/src/container/init_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ impl<'a> InitContainerBuilder<'a> {
}

fn validate_spec(spec: &Spec) -> Result<()> {
if !spec.version().starts_with("1.0") {
let version = spec.version();
if !version.starts_with("1.") {
bail!(
"runtime spec has incompatible version '{}'. Only 1.0.X is supported",
"runtime spec has incompatible version '{}'. Only 1.X.Y is supported",
spec.version()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pub fn attach_controller(cgroup_root: &Path, cgroup_path: &Path, controller: &st

let mut components = cgroup_path
.components()
.into_iter()
.filter(|c| c.ne(&RootDir))
.peekable();

Expand Down
4 changes: 2 additions & 2 deletions tests/rust-integration-tests/runtimetest/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,8 @@ pub fn test_mount_rsuid_option(path: &str) -> Result<(), std::io::Error> {
if suid && sgid {
return Ok(());
}
return Err(std::io::Error::new(
Err(std::io::Error::new(
std::io::ErrorKind::Other,
format!("rsuid error {path:?}"),
));
))
}

0 comments on commit edd63c8

Please sign in to comment.