mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 18:47:03 +00:00
containerd-shim-kata-v2: add the service Pids support
Add the Pids api support to get the processes pids running in the pod. Signed-off-by: fupan <lifupan@gmail.com>
This commit is contained in:
parent
709bc9aa12
commit
8c95b7569d
@ -484,8 +484,19 @@ func (s *service) Kill(ctx context.Context, r *taskAPI.KillRequest) (*ptypes.Emp
|
||||
}
|
||||
|
||||
// Pids returns all pids inside the container
|
||||
// Since for kata, it cannot get the process's pid from VM,
|
||||
// thus only return the Shim's pid directly.
|
||||
func (s *service) Pids(ctx context.Context, r *taskAPI.PidsRequest) (*taskAPI.PidsResponse, error) {
|
||||
return nil, errdefs.ErrNotImplemented
|
||||
var processes []*task.ProcessInfo
|
||||
|
||||
pInfo := task.ProcessInfo{
|
||||
Pid: s.pid,
|
||||
}
|
||||
processes = append(processes, &pInfo)
|
||||
|
||||
return &taskAPI.PidsResponse{
|
||||
Processes: processes,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CloseIO of a process
|
||||
|
Loading…
Reference in New Issue
Block a user