Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: only ignore volumes with driver_opts

Andras Bacsai62fe10df31a2
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index 5c65eb218d..dcdaacf112 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,
]);