From 62fe10df31a2ddd6b95423667f8bbb7daa2caaea Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 31 May 2024 14:04:17 +0200 Subject: [PATCH] fix: only ignore volumes with driver_opts --- bootstrap/helpers/shared.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 5c65eb218..dcdaacf11 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -911,7 +911,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal ); } else if ($type->value() === 'volume') { if ($topLevelVolumes->has($source->value())) { - return $volume; + $v = $topLevelVolumes->get($source->value()); + if (data_get($v, 'driver_opts')) { + return $volume; + } } $slugWithoutUuid = Str::slug($source, '-'); $name = "{$savedService->service->uuid}_{$slugWithoutUuid}"; @@ -1375,13 +1378,23 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal if ($pull_request_id !== 0) { $name = $name . "-pr-$pull_request_id"; $volume = str("$name:$mount"); - if (!$topLevelVolumes->has($name)) { + if ($topLevelVolumes->has($name)) { + $v = $topLevelVolumes->get($name); + if (data_get($v, 'driver_opts')) { + // Do nothing + } + } else { $topLevelVolumes->put($name, [ 'name' => $name, ]); } } else { - if (!$topLevelVolumes->has($name->value())) { + if ($topLevelVolumes->has($name->value())) { + $v = $topLevelVolumes->get($name->value()); + if (data_get($v, 'driver_opts')) { + // Do nothing + } + } else { $topLevelVolumes->put($name->value(), [ 'name' => $name->value(), ]); @@ -1429,7 +1442,12 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal data_set($volume, 'source', $source . ':' . $target); } if (!str($source)->startsWith('/')) { - if (!$topLevelVolumes->has($source)) { + if ($topLevelVolumes->has($source)) { + $v = $topLevelVolumes->get($source); + if (data_get($v, 'driver_opts')) { + // Do nothing + } + } else { $topLevelVolumes->put($source, [ 'name' => $source, ]);