mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
Changes auto-committed by Conductor
This commit is contained in:
@@ -378,6 +378,16 @@ function fqdnLabelsForTraefik(string $uuid, Collection $domains, bool $is_force_
|
||||
|
||||
if ($serviceLabels) {
|
||||
$middlewares_from_labels = $serviceLabels->map(function ($item) {
|
||||
// Handle array values from YAML parsing (e.g., "traefik.enable: true" becomes an array)
|
||||
if (is_array($item)) {
|
||||
// Convert array to string format "key=value"
|
||||
$key = collect($item)->keys()->first();
|
||||
$value = collect($item)->values()->first();
|
||||
$item = "$key=$value";
|
||||
}
|
||||
if (! is_string($item)) {
|
||||
return null;
|
||||
}
|
||||
if (preg_match('/traefik\.http\.middlewares\.(.*?)(\.|$)/', $item, $matches)) {
|
||||
return $matches[1];
|
||||
}
|
||||
|
||||
@@ -1285,6 +1285,12 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
if ($serviceLabels->count() > 0) {
|
||||
$removedLabels = collect([]);
|
||||
$serviceLabels = $serviceLabels->filter(function ($serviceLabel, $serviceLabelName) use ($removedLabels) {
|
||||
// Handle array values from YAML (e.g., "traefik.enable: true" becomes an array)
|
||||
if (is_array($serviceLabel)) {
|
||||
$removedLabels->put($serviceLabelName, $serviceLabel);
|
||||
|
||||
return false;
|
||||
}
|
||||
if (! str($serviceLabel)->contains('=')) {
|
||||
$removedLabels->put($serviceLabelName, $serviceLabel);
|
||||
|
||||
@@ -1294,6 +1300,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
return $serviceLabel;
|
||||
});
|
||||
foreach ($removedLabels as $removedLabelName => $removedLabel) {
|
||||
// Convert array values to strings
|
||||
if (is_array($removedLabel)) {
|
||||
$removedLabel = (string) collect($removedLabel)->first();
|
||||
}
|
||||
$serviceLabels->push("$removedLabelName=$removedLabel");
|
||||
}
|
||||
}
|
||||
@@ -2005,6 +2015,12 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
if ($serviceLabels->count() > 0) {
|
||||
$removedLabels = collect([]);
|
||||
$serviceLabels = $serviceLabels->filter(function ($serviceLabel, $serviceLabelName) use ($removedLabels) {
|
||||
// Handle array values from YAML (e.g., "traefik.enable: true" becomes an array)
|
||||
if (is_array($serviceLabel)) {
|
||||
$removedLabels->put($serviceLabelName, $serviceLabel);
|
||||
|
||||
return false;
|
||||
}
|
||||
if (! str($serviceLabel)->contains('=')) {
|
||||
$removedLabels->put($serviceLabelName, $serviceLabel);
|
||||
|
||||
@@ -2014,6 +2030,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
return $serviceLabel;
|
||||
});
|
||||
foreach ($removedLabels as $removedLabelName => $removedLabel) {
|
||||
// Convert array values to strings
|
||||
if (is_array($removedLabel)) {
|
||||
$removedLabel = (string) collect($removedLabel)->first();
|
||||
}
|
||||
$serviceLabels->push("$removedLabelName=$removedLabel");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user