Support "Long Syntax" for volumes.

This commit is contained in:
Karl Wilbur 2018-04-12 13:54:26 -04:00
parent 78c83037ee
commit 1b9e7782e0

View file

@ -306,7 +306,13 @@ function makeVerticesAndEdges(Graph $graph, array $services, array $volumes, arr
$serviceVolumes = [];
foreach ($definition['volumes'] ?? [] as $volume) {
list($host, $container, $attr) = explodeMapping($volume);
if (is_array($volume)) {
$host = $volume['source'];
$container = $volume['target'];
$attr = !empty($volume['read-only']) ? 'ro' : '';
} else {
list($host, $container, $attr) = explodeMapping($volume);
}
$serviceVolumes[$container] = [$host, $attr];
}