Skip to content

Commit

Permalink
chore(deps): update oci-spec to v0.6.7
Browse files Browse the repository at this point in the history
there is a breaking change in the public API of the oci-spec crate. This commit fixes the issue.

Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka committed Jul 12, 2024
1 parent a239031 commit a246960
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 deletions.
25 changes: 23 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/libcgroups/src/v1/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ mod tests {
set_fixture(tmp.path(), "devices.deny", "").expect("create denied devices list");

Devices::apply_device(d, tmp.path()).expect("Apply default device");
println!("Device: {}", d.to_string());
println!("Device: {}", d);
if d.allow() {
let allowed_content =
read_to_string(tmp.path().join("devices.allow")).expect("read to string");
Expand Down Expand Up @@ -125,7 +125,7 @@ mod tests {
set_fixture(tmp.path(), "devices.deny", "").expect("create denied devices list");

Devices::apply_device(d, tmp.path()).expect("Apply default device");
println!("Device: {}", d.to_string());
println!("Device: {}", d);
if d.allow() {
let allowed_content =
read_to_string(tmp.path().join("devices.allow")).expect("read to string");
Expand Down
2 changes: 1 addition & 1 deletion crates/libcontainer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ nix = { version = "0.28.0", features = [
"term",
"hostname",
] }
oci-spec = { version = "~0.6.4", features = ["runtime"] }
oci-spec = { version = "0.6.7", features = ["runtime"] }
once_cell = "1.19.0"
procfs = "0.16.0"
prctl = "1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/syscall/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use nix::mount::{mount, umount2, MntFlags, MsFlags};
use nix::sched::{unshare, CloneFlags};
use nix::sys::stat::{mknod, Mode, SFlag};
use nix::unistd::{chown, chroot, fchdir, pivot_root, sethostname, Gid, Uid};
use oci_spec::runtime::LinuxRlimit;
use oci_spec::runtime::PosixRlimit;

use super::{Result, Syscall, SyscallError};
use crate::{capabilities, utils};
Expand Down Expand Up @@ -386,7 +386,7 @@ impl Syscall for LinuxSyscall {
}

/// Sets resource limit for process
fn set_rlimit(&self, rlimit: &LinuxRlimit) -> Result<()> {
fn set_rlimit(&self, rlimit: &PosixRlimit) -> Result<()> {
let rlim = &libc::rlimit {
rlim_cur: rlimit.soft(),
rlim_max: rlimit.hard(),
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/syscall/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use nix::mount::MsFlags;
use nix::sched::CloneFlags;
use nix::sys::stat::{Mode, SFlag};
use nix::unistd::{Gid, Uid};
use oci_spec::runtime::LinuxRlimit;
use oci_spec::runtime::PosixRlimit;

use crate::syscall::linux::{LinuxSyscall, MountAttr};
use crate::syscall::test::TestHelperSyscall;
Expand All @@ -30,7 +30,7 @@ pub trait Syscall {
fn set_capability(&self, cset: CapSet, value: &CapsHashSet) -> Result<()>;
fn set_hostname(&self, hostname: &str) -> Result<()>;
fn set_domainname(&self, domainname: &str) -> Result<()>;
fn set_rlimit(&self, rlimit: &LinuxRlimit) -> Result<()>;
fn set_rlimit(&self, rlimit: &PosixRlimit) -> Result<()>;
fn get_pwuid(&self, uid: u32) -> Option<Arc<OsStr>>;
fn mount(
&self,
Expand Down
4 changes: 2 additions & 2 deletions crates/libcontainer/src/syscall/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use nix::mount::MsFlags;
use nix::sched::CloneFlags;
use nix::sys::stat::{Mode, SFlag};
use nix::unistd::{Gid, Uid};
use oci_spec::runtime::LinuxRlimit;
use oci_spec::runtime::PosixRlimit;

use super::{linux, Result, Syscall};

Expand Down Expand Up @@ -173,7 +173,7 @@ impl Syscall for TestHelperSyscall {
.act(ArgName::Domainname, Box::new(domainname.to_owned()))
}

fn set_rlimit(&self, _rlimit: &LinuxRlimit) -> Result<()> {
fn set_rlimit(&self, _rlimit: &PosixRlimit) -> Result<()> {
todo!()
}

Expand Down

0 comments on commit a246960

Please sign in to comment.