summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-03-28 09:13:50 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-29 02:18:45 +0000
commit4ea493d5a1138f41cb2d0f3266e0320f5d6932fe (patch)
treed020831499775cbaa8f1e515d4dd55d81cc92db5
parent73e13cf688ca1760427f509ebbd5fe4b0b2e4313 (diff)
downloadpodman-4ea493d5a1138f41cb2d0f3266e0320f5d6932fe.tar.gz
podman-4ea493d5a1138f41cb2d0f3266e0320f5d6932fe.tar.bz2
podman-4ea493d5a1138f41cb2d0f3266e0320f5d6932fe.zip
Only start containers that are not running in pod start
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #557 Approved by: rhatdan
-rw-r--r--libpod/pod.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/libpod/pod.go b/libpod/pod.go
index 9f7ad5876..f7059800a 100644
--- a/libpod/pod.go
+++ b/libpod/pod.go
@@ -165,11 +165,13 @@ func startNode(node *containerNode, setError bool, ctrErrors map[string]error, c
// Going to start the container, mark us as visited
ctrsVisited[node.id] = true
- // Start the container
+ // Start the container (only if it is not running)
ctrErrored := false
- if err := node.container.initAndStart(); err != nil {
- ctrErrored = true
- ctrErrors[node.id] = err
+ if node.container.state.State != ContainerStateRunning {
+ if err := node.container.initAndStart(); err != nil {
+ ctrErrored = true
+ ctrErrors[node.id] = err
+ }
}
// Recurse to anyone who depends on us and start them