Fix container retrieval in CheckLogDrainContainerJob and ContainerStatusJob

This commit is contained in:
Andras Bacsai 2023-11-29 17:03:04 +01:00
parent 243d1c06fc
commit 5c7ef80219
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ public function handle(): void
if (!$this->server->isServerReady()) {
return;
};
$containers = instant_remote_process(["docker container ls -q"], $this->server);
$containers = instant_remote_process(["docker container ls -q"], $this->server, false);
if (!$containers) {
return;
}

View File

@ -47,7 +47,7 @@ public function handle()
$containerReplicase = instant_remote_process(["docker service ls --format '{{json .}}'"], $this->server, false);
} else {
// Precheck for containers
$containers = instant_remote_process(["docker container ls -q"], $this->server);
$containers = instant_remote_process(["docker container ls -q"], $this->server, false);
if (!$containers) {
return;
}
@ -95,7 +95,6 @@ public function handle()
$uuid = data_get($labels, 'coolify.name');
} else {
$labels = data_get($container, 'Config.Labels');
$uuid = data_get($labels, 'com.docker.compose.service');
}
$containerStatus = data_get($container, 'State.Status');
$containerHealth = data_get($container, 'State.Health.Status', 'unhealthy');
@ -131,6 +130,7 @@ public function handle()
}
}
} else {
$uuid = data_get($labels, 'com.docker.compose.service');
if ($uuid) {
$database = $databases->where('uuid', $uuid)->first();
if ($database) {