mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
fix(docker): migrate database start actions from --time to -t flag
Migrates 8 database start action files from deprecated --time=10 to compatible -t 10 flag for Docker v28+ compatibility. Also updates test expectations in StopProxyTest.php. Docker deprecated the --time flag in v28.0. The -t shorthand works on all Docker versions (pre-28 and 28+), ensuring backward and forward compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ it('ensures stop proxy includes wait loop for container removal', function () {
|
||||
|
||||
// Simulate the command sequence from StopProxy
|
||||
$commands = [
|
||||
'docker stop --time=30 coolify-proxy 2>/dev/null || true',
|
||||
'docker stop -t 30 coolify-proxy 2>/dev/null || true',
|
||||
'docker rm -f coolify-proxy 2>/dev/null || true',
|
||||
'# Wait for container to be fully removed',
|
||||
'for i in {1..10}; do',
|
||||
@@ -21,7 +21,7 @@ it('ensures stop proxy includes wait loop for container removal', function () {
|
||||
$commandsString = implode("\n", $commands);
|
||||
|
||||
// Verify the stop sequence includes all required components
|
||||
expect($commandsString)->toContain('docker stop --time=30 coolify-proxy')
|
||||
expect($commandsString)->toContain('docker stop -t 30 coolify-proxy')
|
||||
->and($commandsString)->toContain('docker rm -f coolify-proxy')
|
||||
->and($commandsString)->toContain('for i in {1..10}; do')
|
||||
->and($commandsString)->toContain('if ! docker ps -a --format "{{.Names}}" | grep -q "^coolify-proxy$"')
|
||||
@@ -41,7 +41,7 @@ it('includes error suppression in stop proxy commands', function () {
|
||||
// Test that stop/remove commands suppress errors gracefully
|
||||
|
||||
$commands = [
|
||||
'docker stop --time=30 coolify-proxy 2>/dev/null || true',
|
||||
'docker stop -t 30 coolify-proxy 2>/dev/null || true',
|
||||
'docker rm -f coolify-proxy 2>/dev/null || true',
|
||||
];
|
||||
|
||||
@@ -54,9 +54,9 @@ it('uses configurable timeout for docker stop', function () {
|
||||
// Verify that stop command includes the timeout parameter
|
||||
|
||||
$timeout = 30;
|
||||
$stopCommand = "docker stop --time=$timeout coolify-proxy 2>/dev/null || true";
|
||||
$stopCommand = "docker stop -t $timeout coolify-proxy 2>/dev/null || true";
|
||||
|
||||
expect($stopCommand)->toContain('--time=30');
|
||||
expect($stopCommand)->toContain('-t 30');
|
||||
});
|
||||
|
||||
it('waits for swarm service container removal correctly', function () {
|
||||
|
||||
Reference in New Issue
Block a user