Only start containers that are not running in pod start

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #557
Approved by: rhatdan
This commit is contained in:
Matthew Heon
2018-03-28 09:13:50 -04:00
committed by Atomic Bot
parent 73e13cf688
commit 4ea493d5a1

View File

@ -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