mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-26 09:20:54 -04:00
fix(docker): preserve restart policies when stopping containers
This commit is contained in:
@@ -126,7 +126,7 @@ it('can stop an application without removing its containers', function () {
|
||||
|
||||
expect($removeContainers)->not->toBeNull()
|
||||
->and($removeContainers->getDefaultValue())->toBeTrue()
|
||||
->and($action)->toContain('docker update --restart=no')
|
||||
->and($action)->not->toContain('docker update --restart=no')
|
||||
->and($action)->toContain('if ($removeContainers)');
|
||||
});
|
||||
|
||||
|
||||
@@ -6,6 +6,17 @@ it('persists exited status when stopping standalone databases', function () {
|
||||
expect($action)->toContain("'status' => 'exited'");
|
||||
});
|
||||
|
||||
it('does not change Docker restart policies when retaining stopped containers', function (string $actionPath) {
|
||||
$action = file_get_contents(__DIR__.'/../../'.$actionPath);
|
||||
|
||||
expect($action)->not->toContain('docker update --restart=no');
|
||||
})->with([
|
||||
'applications' => 'app/Actions/Application/StopApplication.php',
|
||||
'application previews' => 'app/Actions/Application/StopApplicationPreview.php',
|
||||
'service applications' => 'app/Actions/Service/StopServiceApplication.php',
|
||||
'standalone databases' => 'app/Actions/Database/StopDatabase.php',
|
||||
]);
|
||||
|
||||
it('persists exited status for every full application stop path', function () {
|
||||
$action = file_get_contents(__DIR__.'/../../app/Actions/Application/StopApplication.php');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user