fix(stacks): avoid resource busy error in Docker fallback deletion (#271)

The previous command `rm -rf /cleanup` tried to remove the bind mount
point itself, which the kernel rejects with EBUSY. Changed to
`find /cleanup -mindepth 1 -maxdepth 1 -exec rm -rf {} +` which
removes all contents without touching the mount point. The existing
fsPromises.rmdir() call then cleans up the empty host directory.
This commit is contained in:
Anso
2026-03-29 23:52:40 -04:00
committed by GitHub
parent a334d714ce
commit 10d16361fa
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ describe('FileSystemService.deleteStack', () => {
await expect(promise).resolves.toBeUndefined();
expect(mockSpawn).toHaveBeenCalledWith(
'docker',
expect.arrayContaining(['run', '--rm', '-v', expect.stringContaining(':/cleanup'), 'alpine', 'rm', '-rf', '/cleanup']),
expect.arrayContaining(['run', '--rm', '-v', expect.stringContaining(':/cleanup'), 'alpine', 'sh', '-c', 'find /cleanup -mindepth 1 -maxdepth 1 -exec rm -rf {} +']),
expect.objectContaining({ env: expect.any(Object) }),
);
});