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:
12
process.go
12
process.go
@@ -111,6 +111,14 @@ func (p *process) Resize(ctx context.Context, w, h uint32) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *process) Delete() error {
|
||||
return p.io.Close()
|
||||
func (p *process) Delete(ctx context.Context) (uint32, error) {
|
||||
cerr := p.io.Close()
|
||||
r, err := p.task.client.TaskService().DeleteProcess(ctx, &execution.DeleteProcessRequest{
|
||||
ContainerID: p.task.containerID,
|
||||
Pid: p.pid,
|
||||
})
|
||||
if err != nil {
|
||||
return UnknownExitStatus, err
|
||||
}
|
||||
return r.ExitStatus, cerr
|
||||
}
|
||||
|
Reference in New Issue
Block a user