Skip to content

Commit dfd5cc9

Browse files
committed
fix: log drain only for Applications
1 parent a2ab235 commit dfd5cc9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bootstrap/helpers/shared.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,8 +2819,10 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
28192819
$defaultLabels = defaultLabels($resource->id, $containerName, $pull_request_id, type: 'application');
28202820
$serviceLabels = $serviceLabels->merge($defaultLabels);
28212821

2822-
if ($server->isLogDrainEnabled() && $resource->isLogDrainEnabled()) {
2823-
data_set($service, 'logging', generate_fluentd_configuration());
2822+
if ($server->isLogDrainEnabled()) {
2823+
if ($resource instanceof Application && $resource->isLogDrainEnabled()) {
2824+
data_set($service, 'logging', generate_fluentd_configuration());
2825+
}
28242826
}
28252827
if ($serviceLabels->count() > 0) {
28262828
if ($resource->settings->is_container_label_escape_enabled) {
@@ -2923,8 +2925,10 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
29232925
$restart = data_get_str($service, 'restart', RESTART_MODE);
29242926
$logging = data_get($service, 'logging');
29252927

2926-
if ($server->isLogDrainEnabled() && $resource->isLogDrainEnabled()) {
2927-
$logging = generate_fluentd_configuration();
2928+
if ($server->isLogDrainEnabled()) {
2929+
if ($resource instanceof Application && $resource->isLogDrainEnabled()) {
2930+
$logging = generate_fluentd_configuration();
2931+
}
29282932
}
29292933
$volumes = collect(data_get($service, 'volumes', []));
29302934
$networks = collect(data_get($service, 'networks', []));

0 commit comments

Comments
 (0)