mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
ListProcesses through PID when cgroup is not found in Linux (#25198)
* ListProcesses through PID when cgroup is not found * add changelog entry * update the ListByPid for windows
This commit is contained in:
@@ -103,7 +103,13 @@ func (e *UniversalExecutor) setSubCmdCgroup(cmd *exec.Cmd, cgroup string) (func(
|
||||
}
|
||||
|
||||
func (e *UniversalExecutor) ListProcesses() set.Collection[procstats.ProcessID] {
|
||||
return procstats.List(e.command)
|
||||
switch cgroupslib.GetMode() {
|
||||
case cgroupslib.OFF:
|
||||
// cgroup is unavailable, could possibly due to rootless nomad client
|
||||
return procstats.ListByPid(e.childCmd.Process.Pid)
|
||||
default:
|
||||
return procstats.List(e.command)
|
||||
}
|
||||
}
|
||||
|
||||
func (e *UniversalExecutor) statCG(cgroup string) (int, func(), error) {
|
||||
|
||||
Reference in New Issue
Block a user