mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-28 03:06:57 +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();
|
await expect(promise).resolves.toBeUndefined();
|
||||||
expect(mockSpawn).toHaveBeenCalledWith(
|
expect(mockSpawn).toHaveBeenCalledWith(
|
||||||
'docker',
|
'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) }),
|
expect.objectContaining({ env: expect.any(Object) }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ export class FileSystemService {
|
|||||||
'run', '--rm',
|
'run', '--rm',
|
||||||
'-v', `${dirPath}:/cleanup`,
|
'-v', `${dirPath}:/cleanup`,
|
||||||
'alpine',
|
'alpine',
|
||||||
'rm', '-rf', '/cleanup'
|
'sh', '-c', 'find /cleanup -mindepth 1 -maxdepth 1 -exec rm -rf {} +'
|
||||||
], {
|
], {
|
||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
|
|||||||
Reference in New Issue
Block a user