mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-10 20:32:54 +00:00
Merge pull request #794 from c3d/bug/793-bad-match
rust-agent: Replaces improper use of match for non-constant patterns
This commit is contained in:
commit
ec09971d8e
@ -103,19 +103,16 @@ fn register_memory_event_v2(
|
|||||||
}
|
}
|
||||||
info!(sl!(), "event.wd: {:?}", event.wd);
|
info!(sl!(), "event.wd: {:?}", event.wd);
|
||||||
|
|
||||||
match event.wd {
|
if event.wd == ev_fd {
|
||||||
ev_fd => {
|
let oom = get_value_from_cgroup(&event_control_path, "oom_kill");
|
||||||
let oom = get_value_from_cgroup(&event_control_path, "oom_kill");
|
if oom.unwrap_or(0) > 0 {
|
||||||
if oom.unwrap_or(0) > 0 {
|
sender.send(containere_id.clone()).unwrap();
|
||||||
sender.send(containere_id.clone()).unwrap();
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cg_fd => {
|
} else if event.wd == cg_fd {
|
||||||
let pids = get_value_from_cgroup(&cgroup_event_control_path, "populated");
|
let pids = get_value_from_cgroup(&cgroup_event_control_path, "populated");
|
||||||
if pids.unwrap_or(-1) == 0 {
|
if pids.unwrap_or(-1) == 0 {
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user