fix: Handle conditions in depends_on

Closes #22
This commit is contained in:
jubianchi 2017-11-17 00:15:11 +01:00
parent acc508b1d8
commit 155f0e1fad
No known key found for this signature in database
GPG key ID: A2FE00848B6AEB23

View file

@ -256,10 +256,10 @@ function makeVerticesAndEdges(Graph $graph, array $services, array $volumes, arr
); );
} }
foreach ($definition['depends_on'] ?? [] as $dependency) { foreach ($definition['depends_on'] ?? [] as $key => $dependency) {
addRelation( addRelation(
$graph->getVertex($service), $graph->getVertex($service),
addService($graph, $dependency), addService($graph, is_array($dependency) ? $key : $dependency),
'depends_on' 'depends_on'
); );
} }