diff options
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index 05b3e89e6..3693ab78b 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -313,6 +313,11 @@ func (c *Container) Start() error { return errors.Wrapf(ErrCtrStateInvalid, "container %s must be in Created or Stopped state to be started", c.ID()) } + // TODO remove this when we patch conmon to support restarting containers + if c.state.State == ContainerStateStopped { + return errors.Wrapf(ErrNotImplemented, "restarting a stopped container is not yet supported") + } + // Mount storage for the container if err := c.mountStorage(); err != nil { return err @@ -519,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 |