mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 10:23:30 +00:00
fix(upgrade): wait for new version before showing success
Expose the running Coolify version on /api/health and only treat an upgrade as complete once that version meets the target. Parse upgrade status in a shared service, start the update after the Livewire response, and keep polling when the instance is still on the old version.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Api\OtherController;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
it('adds the running version header on the healthcheck response', function () {
|
||||
config(['constants.coolify.version' => '4.3.1']);
|
||||
|
||||
$response = (new OtherController)->healthcheck(Request::create('/api/health', 'GET'));
|
||||
|
||||
expect($response->getContent())->toBe('OK')
|
||||
->and($response->headers->get('X-Coolify-Version'))->toBe('4.3.1');
|
||||
});
|
||||
|
||||
it('exposes the running Coolify version on the public health endpoint', function () {
|
||||
config(['constants.coolify.version' => '4.3.1']);
|
||||
|
||||
$this->get('/api/health')
|
||||
->assertSuccessful()
|
||||
->assertSee('OK')
|
||||
->assertHeader('X-Coolify-Version', '4.3.1');
|
||||
});
|
||||
Reference in New Issue
Block a user