Merge pull request #40 from karlwilbur/volumes-long-syntax

Support "Long Syntax" for volumes.
This commit is contained in:
Julien BIANCHI 2020-05-27 22:42:54 +02:00 committed by GitHub
commit c025ca9266
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -306,7 +306,13 @@ function makeVerticesAndEdges(Graph $graph, array $services, array $volumes, arr
$serviceVolumes = [];
foreach ($definition['volumes'] ?? [] as $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];
}