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:
@@ -191,9 +191,16 @@ func (p *initProcess) Exited(status int) {
|
||||
}
|
||||
|
||||
func (p *initProcess) Delete(context context.Context) error {
|
||||
status, err := p.ContainerStatus(context)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if status != "stopped" {
|
||||
return fmt.Errorf("cannot delete a running container")
|
||||
}
|
||||
p.killAll(context)
|
||||
p.Wait()
|
||||
err := p.runc.Delete(context, p.id)
|
||||
err = p.runc.Delete(context, p.id)
|
||||
if p.io != nil {
|
||||
for _, c := range p.closers {
|
||||
c.Close()
|
||||
|
Reference in New Issue
Block a user