mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 12:44:39 +00:00
agent: Agent invokes OCI hooks with wrong PID
Agent sends -1 PID when invoking OCI hooks. OCI state struct is initialized before obtaining PID, so this PR moves `oci_state` call down, right after we get the id. Fixes: #1458 Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
2c42be0ca6
commit
a42dc74898
@ -834,8 +834,6 @@ impl BaseContainer for LinuxContainer {
|
|||||||
}
|
}
|
||||||
let linux = spec.linux.as_ref().unwrap();
|
let linux = spec.linux.as_ref().unwrap();
|
||||||
|
|
||||||
let st = self.oci_state()?;
|
|
||||||
|
|
||||||
let (pfd_log, cfd_log) = unistd::pipe().context("failed to create pipe")?;
|
let (pfd_log, cfd_log) = unistd::pipe().context("failed to create pipe")?;
|
||||||
|
|
||||||
let _ = fcntl::fcntl(pfd_log, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))
|
let _ = fcntl::fcntl(pfd_log, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC))
|
||||||
@ -938,6 +936,8 @@ impl BaseContainer for LinuxContainer {
|
|||||||
|
|
||||||
info!(logger, "child pid: {}", p.pid);
|
info!(logger, "child pid: {}", p.pid);
|
||||||
|
|
||||||
|
let st = self.oci_state()?;
|
||||||
|
|
||||||
join_namespaces(
|
join_namespaces(
|
||||||
&logger,
|
&logger,
|
||||||
&spec,
|
&spec,
|
||||||
|
Loading…
Reference in New Issue
Block a user