Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
containerd-shim-kata-v2: add the service Pids support
Browse files Browse the repository at this point in the history
Add the Pids api support to get the processes
pids running in the pod.

Signed-off-by: fupan <lifupan@gmail.com>
  • Loading branch information
lifupan committed Nov 28, 2018
1 parent 709bc9a commit 8c95b75
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion containerd-shim-v2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c95b75

Please # to comment.