mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-27 12:18:59 +00:00
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:
@@ -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) }),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -205,7 +205,7 @@ export class FileSystemService {
|
||||
'run', '--rm',
|
||||
'-v', `${dirPath}:/cleanup`,
|
||||
'alpine',
|
||||
'rm', '-rf', '/cleanup'
|
||||
'sh', '-c', 'find /cleanup -mindepth 1 -maxdepth 1 -exec rm -rf {} +'
|
||||
], {
|
||||
env: {
|
||||
...process.env,
|
||||
|
||||
Reference in New Issue
Block a user