From 9cb694e094f10fc9191dda707a92893c1fbd1761 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 4 May 2018 14:55:02 -0400 Subject: Make invalid state nonfatal when cleaning up in run Signed-off-by: Matthew Heon Closes: #726 Approved by: baude --- cmd/podman/run.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/podman/run.go b/cmd/podman/run.go index 06bc0e9df..5247f536c 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -227,7 +227,10 @@ func runCmd(c *cli.Context) error { if err := ctr.Cleanup(); err != nil { // If the container has been removed already, no need to error on cleanup - if errors.Cause(err) == libpod.ErrNoSuchCtr || errors.Cause(err) == libpod.ErrCtrRemoved { + // Also, if it was restarted, don't error either + if errors.Cause(err) == libpod.ErrNoSuchCtr || + errors.Cause(err) == libpod.ErrCtrRemoved || + errors.Cause(err) == libpod.ErrCtrStateInvalid { return nil } -- cgit v1.2.3-54-g00ecf