feat: add service/resource/project labels
This commit is contained in:
@@ -2059,7 +2059,16 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
} else {
|
||||
$fqdns = collect(data_get($savedService, 'fqdns'))->filter();
|
||||
}
|
||||
$defaultLabels = defaultLabels($resource->id, $containerName, type: 'service', subType: $isDatabase ? 'database' : 'application', subId: $savedService->id);
|
||||
$defaultLabels = defaultLabels(
|
||||
id: $resource->id,
|
||||
name: $containerName,
|
||||
projectName: $resource->project()->name,
|
||||
resourceName: $resource->name,
|
||||
type: 'service',
|
||||
subType: $isDatabase ? 'database' : 'application',
|
||||
subId: $savedService->id,
|
||||
subName: $savedService->name,
|
||||
);
|
||||
$serviceLabels = $serviceLabels->merge($defaultLabels);
|
||||
if (! $isDatabase && $fqdns->count() > 0) {
|
||||
if ($fqdns) {
|
||||
@@ -2887,7 +2896,15 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
}
|
||||
}
|
||||
}
|
||||
$defaultLabels = defaultLabels($resource->id, $containerName, $pull_request_id, type: 'application');
|
||||
|
||||
$defaultLabels = defaultLabels(
|
||||
id: $resource->id,
|
||||
name: $containerName,
|
||||
projectName: $resource->project()->name,
|
||||
resourceName: $resource->name,
|
||||
pull_request_id: $pull_request_id,
|
||||
type: 'application'
|
||||
);
|
||||
$serviceLabels = $serviceLabels->merge($defaultLabels);
|
||||
|
||||
if ($server->isLogDrainEnabled()) {
|
||||
@@ -3673,6 +3690,8 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
||||
$defaultLabels = defaultLabels(
|
||||
id: $resource->id,
|
||||
name: $containerName,
|
||||
projectName: $resource->project()->name,
|
||||
resourceName: $resource->name,
|
||||
pull_request_id: $pullRequestId,
|
||||
type: 'application'
|
||||
);
|
||||
@@ -3682,7 +3701,17 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
||||
} else {
|
||||
$fqdns = collect(data_get($savedService, 'fqdns'))->filter();
|
||||
}
|
||||
$defaultLabels = defaultLabels($resource->id, $containerName, type: 'service', subType: $isDatabase ? 'database' : 'application', subId: $savedService->id);
|
||||
|
||||
$defaultLabels = defaultLabels(
|
||||
id: $resource->id,
|
||||
name: $containerName,
|
||||
projectName: $resource->project()->name,
|
||||
resourceName: $resource->name,
|
||||
type: 'service',
|
||||
subType: $isDatabase ? 'database' : 'application',
|
||||
subId: $savedService->id,
|
||||
subName: $savedService->human_name ?? $savedService->name,
|
||||
);
|
||||
}
|
||||
// Add COOLIFY_FQDN & COOLIFY_URL to environment
|
||||
if (! $isDatabase && $fqdns instanceof Collection && $fqdns->count() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user