mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 04:18:34 +00:00
fix(sentinel): prevent restart after Sentinel is disabled (#11298)
This commit is contained in:
1 parent
1c25b58dc8
commit
81ed9a3af2
2 files changed
+48
-3
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use App\Jobs\CheckAndStartSentinelJob;
|
||||
use App\Models\Server;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
it('does not start Sentinel after it has been disabled', function () {
|
||||
DB::table('instance_settings')->insert(['id' => 0]);
|
||||
$user = User::factory()->create();
|
||||
$server = Server::factory()->create([
|
||||
'team_id' => $user->teams()->first()->id,
|
||||
]);
|
||||
$server->settings->update([
|
||||
'is_metrics_enabled' => false,
|
||||
'is_sentinel_enabled' => false,
|
||||
]);
|
||||
|
||||
(new CheckAndStartSentinelJob($server))->handle();
|
||||
|
||||
expect((bool) $server->settings->fresh()->is_sentinel_enabled)->toBeFalse();
|
||||
});
|
||||
Reference in new issue
Block a user