diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-11-27 10:23:10 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-11-28 09:35:30 -0500 |
commit | fc774ac0e5f6b906484723c600f43a66516a208a (patch) | |
tree | 40b8a624e3f646ec9cb0bef8e1d14988feacbfb3 | |
parent | d346996e1512ef6efb3800d6cb762d0409d12459 (diff) | |
download | podman-fc774ac0e5f6b906484723c600f43a66516a208a.tar.gz podman-fc774ac0e5f6b906484723c600f43a66516a208a.tar.bz2 podman-fc774ac0e5f6b906484723c600f43a66516a208a.zip |
Stopping a stopped container is not an error for Podman
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
-rw-r--r-- | cmd/podman/stop.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/podman/stop.go b/cmd/podman/stop.go index 04022839a..ade51705e 100644 --- a/cmd/podman/stop.go +++ b/cmd/podman/stop.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "github.com/containers/libpod/cmd/podman/libpodruntime" "github.com/containers/libpod/cmd/podman/shared" "github.com/containers/libpod/libpod" @@ -77,7 +78,11 @@ func stopCmd(c *cli.Context) error { stopTimeout = ctr.StopTimeout() } f := func() error { - return con.StopWithTimeout(stopTimeout) + if err := con.StopWithTimeout(stopTimeout); err != nil && errors.Cause(err) != libpod.ErrCtrStopped { + return err + } + return nil + } stopFuncs = append(stopFuncs, shared.ParallelWorkerInput{ ContainerID: con.ID(), |