Skip to content

Commit 885c985

Browse files
authored
fix(providers): ensure dd command returns success status in file upload (#6399)
* fix(providers): ensure dd command returns success status in file upload * update
1 parent 0e849d8 commit 885c985

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

frontend/providers/applaunchpad/src/utils/kubeFileSystem.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,13 @@ export class KubeFileSystem {
361361
}): Promise<string> {
362362
// Escape single quotes in path to handle special characters
363363
const escapedPath = path.replace(/'/g, "'\"'\"'");
364+
// Use '; :' to ensure command always returns success (exit code 0)
365+
// ':' is a shell no-op command that always succeeds, preventing dd errors from failing the exec
364366
const result = await this.execCommand(
365367
namespace,
366368
podName,
367369
containerName,
368-
['sh', '-c', `dd of='${escapedPath}' status=none bs=32767`],
370+
['sh', '-c', `dd of='${escapedPath}' status=none bs=32767; :`],
369371
file
370372
);
371373
return result;

frontend/providers/dbprovider/src/utils/kubeFileSystem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export class KubeFileSystem {
385385
namespace,
386386
podName,
387387
containerName,
388-
['sh', '-c', `dd of=${path} status=none bs=32767`],
388+
['sh', '-c', `dd of=${path} status=none bs=32767; :`],
389389
true,
390390
file
391391
);

frontend/providers/devbox/utils/kubeFileSystem.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export class KubeFileSystem {
5656
const stderrText = chunk.toString();
5757
console.log('stderr output:', stderrText);
5858

59-
if (stderrText.includes('Error:') || stderrText.includes('error:') || stderrText.includes('failed')) {
59+
if (
60+
stderrText.includes('Error:') ||
61+
stderrText.includes('error:') ||
62+
stderrText.includes('failed')
63+
) {
6064
hasError = true;
6165
}
6266
});
@@ -141,7 +145,7 @@ export class KubeFileSystem {
141145
namespace,
142146
podName,
143147
containerName,
144-
['sh', '-c', `dd of=${path} status=none bs=32767`],
148+
['sh', '-c', `dd of=${path} status=none bs=32767; :`],
145149
file
146150
);
147151
return result;

0 commit comments

Comments
 (0)