mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-12 16:15:17 +00:00
fix(upgrade): use authenticated status polling after restart
Remove the version header from the health endpoint and use upgrade status polling to determine completion.
This commit is contained in:
1 parent
1932673c22
commit
6492d08136
4 files changed
+38
-80
No files matched your search
@@ -119,23 +119,24 @@ it('ignores stale status files older than ten minutes', function () {
|
||||
expect($result['status'])->toBe('none');
|
||||
});
|
||||
|
||||
it('waits for the running version to match the target before showing reload', function () {
|
||||
it('checks the running version through authenticated upgrade status before showing reload', function () {
|
||||
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
|
||||
|
||||
expect($upgradeView)
|
||||
->toContain('X-Coolify-Version')
|
||||
->toContain('hasReachedTargetVersion')
|
||||
->not->toContain('X-Coolify-Version')
|
||||
->toContain('this.$wire.getUpgradeStatus()')
|
||||
->toContain("data.status === 'complete'")
|
||||
->toContain('livewireFailures');
|
||||
});
|
||||
|
||||
it('treats a healthy instance without a version header as ready only after downtime', function () {
|
||||
it('uses the public health endpoint only for liveness during an upgrade', function () {
|
||||
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
|
||||
|
||||
expect($upgradeView)
|
||||
->toContain('instanceWentDown')
|
||||
->toContain('isReadyToReload')
|
||||
->toContain('startHealthWatch')
|
||||
->toContain('data.status === \'none\'');
|
||||
->toContain("fetch('/api/health')")
|
||||
->not->toContain('response.headers.get');
|
||||
});
|
||||
|
||||
it('starts the upgrade after the Livewire response so status polling is not blocked', function () {
|
||||
|
||||
Reference in new issue
Block a user