fix(terminal): distinguish containers across servers
Namespace terminal container targets by server UUID and bump Coolify to 4.3.11.
This commit is contained in:
parent
dd90926583
commit
e82843ac39
6 changed files with 45 additions and 6 deletions
|
|
@ -47,7 +47,7 @@ private function getAllActiveContainers()
|
|||
return [
|
||||
'name' => data_get($container, 'Names'),
|
||||
'connection_name' => data_get($container, 'Names'),
|
||||
'uuid' => data_get($container, 'Names'),
|
||||
'uuid' => $server->uuid.':'.data_get($container, 'Names'),
|
||||
'status' => data_get_str($container, 'State')->lower(),
|
||||
'server' => $server,
|
||||
'server_uuid' => $server->uuid,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
return [
|
||||
'coolify' => [
|
||||
'version' => env('COOLIFY_VERSION') ?: '4.3.10',
|
||||
'version' => env('COOLIFY_VERSION') ?: '4.3.11',
|
||||
'helper_version' => '1.0.15',
|
||||
'realtime_version' => '1.0.17',
|
||||
'railpack_version' => '0.23.0',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"coolify": {
|
||||
"v4": {
|
||||
"version": "4.3.10"
|
||||
"version": "4.3.11"
|
||||
},
|
||||
"nightly": {
|
||||
"version": "4.4-rc.1"
|
||||
|
|
|
|||
39
tests/Feature/TerminalContainerListTest.php
Normal file
39
tests/Feature/TerminalContainerListTest.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use App\Livewire\Terminal\Index;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
function terminalServer(string $uuid, string $name, array $containers): Server
|
||||
{
|
||||
$server = Mockery::mock(Server::class)->makePartial();
|
||||
$server->forceFill(['uuid' => $uuid, 'name' => $name]);
|
||||
$server->shouldReceive('isFunctional')->once()->andReturnTrue();
|
||||
$server->shouldReceive('loadAllContainers')->once()->andReturn(collect($containers));
|
||||
|
||||
return $server;
|
||||
}
|
||||
|
||||
it('keeps containers with the same name on different servers as distinct terminal targets', function () {
|
||||
$component = new Index;
|
||||
$component->servers = new Collection([
|
||||
terminalServer('pulse-uuid', 'Pulse', [
|
||||
['Names' => 'coolify-proxy', 'State' => 'running'],
|
||||
['Names' => 'coolify-sentinel', 'State' => 'running'],
|
||||
]),
|
||||
terminalServer('forge-uuid', 'Forge', [
|
||||
['Names' => 'coolify-proxy', 'State' => 'running'],
|
||||
['Names' => 'coolify-sentinel', 'State' => 'running'],
|
||||
]),
|
||||
]);
|
||||
|
||||
$component->loadContainers();
|
||||
|
||||
expect($component->containers)->toHaveCount(4)
|
||||
->and(collect($component->containers)->pluck('uuid')->all())->toBe([
|
||||
'pulse-uuid:coolify-proxy',
|
||||
'forge-uuid:coolify-proxy',
|
||||
'pulse-uuid:coolify-sentinel',
|
||||
'forge-uuid:coolify-sentinel',
|
||||
]);
|
||||
});
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
->toContain('ARG COOLIFY_VERSION')
|
||||
->toContain('ENV COOLIFY_VERSION=${COOLIFY_VERSION}')
|
||||
->and($constants)
|
||||
->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.10'")
|
||||
->and($versions['coolify']['v4']['version'])->toBe('4.3.10')
|
||||
->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.11'")
|
||||
->and($versions['coolify']['v4']['version'])->toBe('4.3.11')
|
||||
->and($versions['coolify']['nightly']['version'])->toBe('4.4-rc.1')
|
||||
->and($nightlyVersions)->toBe($versions);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"coolify": {
|
||||
"v4": {
|
||||
"version": "4.3.10"
|
||||
"version": "4.3.11"
|
||||
},
|
||||
"nightly": {
|
||||
"version": "4.4-rc.1"
|
||||
|
|
|
|||
Loading…
Reference in a new issue