diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-02-07 16:07:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-07 16:07:46 -0500 |
commit | 11eb18cec62ef964e402ba354a28846366cd8fcc (patch) | |
tree | ec4c586c7f8d496df8b34f494bd6d65f0b6e3d02 /libpod | |
parent | 588c9bb5de08f0c3058a18b401ac87e38cd011be (diff) | |
parent | ca7ebcac641d82a665518fdd7353e9d331efe6a9 (diff) | |
download | podman-11eb18cec62ef964e402ba354a28846366cd8fcc.tar.gz podman-11eb18cec62ef964e402ba354a28846366cd8fcc.tar.bz2 podman-11eb18cec62ef964e402ba354a28846366cd8fcc.zip |
Merge pull request #309 from mheon/pause_state_error
Change pause so only running containers are valid
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_api.go | 4 |
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 |