summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 41e754587..6106cfc12 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -215,6 +215,10 @@ func (c *Container) Stop() error {
return errors.Wrapf(ErrCtrStateInvalid, "can only stop created, running, or stopped containers")
}
+ if c.state.State == ContainerStateStopped {
+ return ErrCtrStopped
+ }
+
return c.stop(c.config.StopTimeout)
}
@@ -237,6 +241,10 @@ func (c *Container) StopWithTimeout(timeout uint) error {
return errors.Wrapf(ErrCtrStateInvalid, "can only stop created, running, or stopped containers")
}
+ if c.state.State == ContainerStateStopped {
+ return ErrCtrStopped
+ }
+
return c.stop(timeout)
}