Add DeleteProcess API for removing execs
We need a separate API for handing the exit status and deletion of Exec'd processes to make sure they are properly cleaned up within the shim and daemon. Fixes #973 Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -171,6 +171,21 @@ func (s *Service) Delete(ctx context.Context, r *api.DeleteRequest) (*api.Delete
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *Service) DeleteProcess(ctx context.Context, r *api.DeleteProcessRequest) (*api.DeleteResponse, error) {
|
||||
c, err := s.getTask(ctx, r.ContainerID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
exit, err := c.DeleteProcess(ctx, r.Pid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &api.DeleteResponse{
|
||||
ExitStatus: exit.Status,
|
||||
ExitedAt: exit.Timestamp,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func taskFromContainerd(ctx context.Context, c plugin.Task) (*task.Task, error) {
|
||||
state, err := c.State(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user