Skip to content

Commit

Permalink
Update version check in validate_spec to support 1.X.Y version.
Browse files Browse the repository at this point in the history
Previously, the validate_spec function only supported runtime spec versions that started with "1.0".
This commit updates the function to support all versions starting with "1." (e.g., 1.X.Y), making it compatible with a broader range of runtime spec versions.

Signed-off-by: utam0k <[email protected]>
  • Loading branch information
utam0k committed Apr 9, 2023
1 parent a930925 commit 85e1fa4
Showing 1 changed file with 3 additions and 2 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

0 comments on commit 85e1fa4

Please sign in to comment.