summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-02-07 10:47:43 -0500
committerMatthew Heon <mheon@redhat.com>2018-02-07 10:47:43 -0500
commitca7ebcac641d82a665518fdd7353e9d331efe6a9 (patch)
treed02d2439d885daa183720e5e936fab229d74564b
parent3f0170227d40b154205eb9f787e6f0254d75749e (diff)
downloadpodman-ca7ebcac641d82a665518fdd7353e9d331efe6a9.tar.gz
podman-ca7ebcac641d82a665518fdd7353e9d331efe6a9.tar.bz2
podman-ca7ebcac641d82a665518fdd7353e9d331efe6a9.zip
Change pause so only running containers are valid
Signed-off-by: Matthew Heon <mheon@redhat.com>
-rw-r--r--libpod/container_api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 3e1d600a8..3693ab78b 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -524,8 +524,8 @@ func (c *Container) Pause() error {
if c.state.State == ContainerStatePaused {
return errors.Wrapf(ErrCtrStateInvalid, "%q is already paused", c.ID())
}
- if c.state.State != ContainerStateRunning && c.state.State != ContainerStateCreated {
- return errors.Wrapf(ErrCtrStateInvalid, "%q is not running/created, can't pause", c.state.State)
+ if c.state.State != ContainerStateRunning {
+ return errors.Wrapf(ErrCtrStateInvalid, "%q is not running, can't pause", c.state.State)
}
if err := c.runtime.ociRuntime.pauseContainer(c); err != nil {
return err