Change ListProcesses to ListPids

These rpcs only return pids []uint32 so should be named that way in
order to have other rpcs that list Processes such as Exec'd processes.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-28 16:09:29 -07:00
parent 55861c1a00
commit e2d5522435
11 changed files with 415 additions and 369 deletions

View File

@@ -340,25 +340,17 @@ func (s *Service) Kill(ctx context.Context, r *api.KillRequest) (*google_protobu
return empty, nil
}
func (s *Service) ListProcesses(ctx context.Context, r *api.ListProcessesRequest) (*api.ListProcessesResponse, error) {
func (s *Service) ListPids(ctx context.Context, r *api.ListPidsRequest) (*api.ListPidsResponse, error) {
t, err := s.getTask(ctx, r.ContainerID)
if err != nil {
return nil, err
}
pids, err := t.Processes(ctx)
pids, err := t.Pids(ctx)
if err != nil {
return nil, err
}
ps := []*task.Process{}
for _, pid := range pids {
ps = append(ps, &task.Process{
Pid: pid,
})
}
return &api.ListProcessesResponse{
Processes: ps,
return &api.ListPidsResponse{
Pids: pids,
}, nil
}