Merge pull request #5470 from farwydi/fix_service_app_log_drain

Fix service app log drain
This commit is contained in:
Andras Bacsai
2025-03-31 17:45:32 +02:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ All notable changes to this project will be documented in this file.
## [4.0.0-beta.399] - 2025-03-25
### 🚀 Features
- *(database)* Disable MongoDB SSL by default in migration

View File

@@ -3175,6 +3175,13 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
}
}
$serviceAppsLogDrainEnabledMap = collect([]);
if ($resource instanceof Service) {
$serviceAppsLogDrainEnabledMap = $resource->applications()->get()->keyBy('name')->map(function ($app) {
return $app->isLogDrainEnabled();
});
}
// Parse the rest of the services
foreach ($services as $serviceName => $service) {
$image = data_get_str($service, 'image');
@@ -3185,6 +3192,9 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
if ($resource instanceof Application && $resource->isLogDrainEnabled()) {
$logging = generate_fluentd_configuration();
}
if ($resource instanceof Service && $serviceAppsLogDrainEnabledMap->get($serviceName)) {
$logging = generate_fluentd_configuration();
}
}
$volumes = collect(data_get($service, 'volumes', []));
$networks = collect(data_get($service, 'networks', []));