fix(docker): add fallback for Docker Swarm container labels
This commit is contained in:
parent
40778ad44d
commit
cc53e9476e
1 changed files with 6 additions and 0 deletions
|
|
@ -145,6 +145,12 @@ public function handle(Server $server, ?Collection $containers = null, ?Collecti
|
|||
$this->applicationContainerStatuses->put($applicationId, collect());
|
||||
}
|
||||
$containerName = data_get($labels, 'com.docker.compose.service');
|
||||
// Fallback for Docker Swarm which uses different labels
|
||||
if (! $containerName && $this->server->isSwarm()) {
|
||||
$containerName = data_get($labels, 'coolify.serviceName')
|
||||
?? data_get($labels, 'coolify.name')
|
||||
?? data_get($labels, 'com.docker.stack.namespace');
|
||||
}
|
||||
if ($containerName) {
|
||||
$this->applicationContainerStatuses->get($applicationId)->put($containerName, $containerStatus);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue