diff options
author | Aditya Rajan <arajan@redhat.com> | 2021-09-27 15:17:38 +0530 |
---|---|---|
committer | Aditya Rajan <arajan@redhat.com> | 2021-09-27 17:27:15 +0530 |
commit | 8fca626e33670d49b4e8f06e09f0a87df3dca1fe (patch) | |
tree | 4fb15cfae95226a5b51d4af2d88aa483c8d627ac /pkg/domain | |
parent | 869cb9a65413cc99bf8ed0e158c0e2f7b0df513a (diff) | |
download | podman-8fca626e33670d49b4e8f06e09f0a87df3dca1fe.tar.gz podman-8fca626e33670d49b4e8f06e09f0a87df3dca1fe.tar.bz2 podman-8fca626e33670d49b4e8f06e09f0a87df3dca1fe.zip |
stop: Do nothing if container was never created in runtime
Following commit ensures we silently return container id on `stop` if
container was never created in OCI runtime.
Following behaviour ensures that we are in parity with docker.
Signed-off-by: Aditya Rajan <arajan@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 02af214a6..8e7e2d411 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -169,6 +169,10 @@ func (ic *ContainerEngine) ContainerStop(ctx context.Context, namesOrIds []strin logrus.Debugf("Container %s is already stopped", c.ID()) case options.All && errors.Cause(err) == define.ErrCtrStateInvalid: logrus.Debugf("Container %s is not running, could not stop", c.ID()) + // container never created in OCI runtime + // docker parity: do nothing just return container id + case errors.Cause(err) == define.ErrCtrStateInvalid: + logrus.Debugf("Container %s is either not created on runtime or is in a invalid state", c.ID()) default: return err } |