Skip to content

Commit

Permalink
ctr: Allow deleting a container in the Created state
Browse files Browse the repository at this point in the history
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
  • Loading branch information
mlaventure committed Jul 21, 2017
1 parent 4d14bfd commit 8e12d1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/ctr/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ var deleteCommand = cli.Command{
if err != nil {
return err
}
if status == containerd.Stopped {
if status == containerd.Stopped || status == containerd.Created {
if _, err := task.Delete(ctx); err != nil {
return err
}
return container.Delete(ctx, deleteOpts...)
}
return fmt.Errorf("cannot delete a container with an existing task")
return fmt.Errorf("cannot delete a non stopped container: %v", status)
},
}

0 comments on commit 8e12d1f

Please sign in to comment.