Skip to content

Commit

Permalink
Making sure children slice exist
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Schendel <[email protected]>
  • Loading branch information
amitschendel committed Oct 30, 2024
1 parent c0798a9 commit 2016b8e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pkg/processmanager/v1/process_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func (p *ProcessManager) ReportEvent(eventType utils.EventType, event utils.K8sE
Cwd: execEvent.Cwd,
Pcomm: execEvent.Pcomm,
Cmdline: strings.Join(execEvent.Args, " "),
Children: []apitypes.Process{},
}

p.addProcess(process)
Expand Down Expand Up @@ -376,14 +377,15 @@ func getProcessFromProc(pid int) (apitypes.Process, error) {
path, _ := proc.Executable()

return apitypes.Process{
PID: uint32(pid),
PPID: uint32(stat.PPID),
Comm: stat.Comm,
Uid: &uid,
Gid: &gid,
Cmdline: strings.Join(cmdline, " "),
Cwd: cwd,
Path: path,
PID: uint32(pid),
PPID: uint32(stat.PPID),
Comm: stat.Comm,
Uid: &uid,
Gid: &gid,
Cmdline: strings.Join(cmdline, " "),
Cwd: cwd,
Path: path,
Children: []apitypes.Process{},
}, nil
}

Expand Down

0 comments on commit 2016b8e

Please sign in to comment.