From 4ea493d5a1138f41cb2d0f3266e0320f5d6932fe Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 28 Mar 2018 09:13:50 -0400 Subject: Only start containers that are not running in pod start Signed-off-by: Matthew Heon Closes: #557 Approved by: rhatdan --- libpod/pod.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libpod') 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 -- cgit v1.2.3-54-g00ecf