Allow exec process to be deleted in created state

Fixes #1376

This allows an exec process to be deleted in the created state.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-08-17 14:50:30 -04:00
parent 873a34649a
commit bf82de3a4e
3 changed files with 86 additions and 3 deletions

View File

@@ -152,7 +152,8 @@ func (p *process) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (uint32
if err != nil {
return UnknownExitStatus, err
}
if status.Status != Stopped {
switch status.Status {
case Running, Paused, Pausing:
return UnknownExitStatus, errors.Wrapf(errdefs.ErrFailedPrecondition, "process must be stopped before deletion")
}
if p.io != nil {