fix: require explicit trans shell operations

This commit is contained in:
Codex
2026-06-15 04:01:04 +00:00
parent b2c2819fe2
commit b8fb3c41a8
18 changed files with 241 additions and 273 deletions
+3 -3
View File
@@ -1077,7 +1077,7 @@ async function remoteApplyManifest(config: UniDeskConfig, path: string, target =
"kubectl apply -f \"$tmp\"",
].join("\n");
emitCiInstallProgress("kubectl-apply", "started", { providerId: target.providerId, manifest: path });
const result = await runSshCommandCapture(config, `${target.providerId}:k3s`, ["script"], script);
const result = await runSshCommandCapture(config, `${target.providerId}:k3s`, ["sh"], script);
if (result.exitCode !== 0) throw new Error(`kubectl apply failed for ${path}: ${result.stderr || result.stdout}`);
emitCiInstallProgress("upload-manifest", "succeeded", { providerId: target.providerId, manifest: path, upload: result.stdout.split(/\r?\n/u).find((line) => line.startsWith("manifest_bytes=")) ?? "" });
emitCiInstallProgress("kubectl-apply", "succeeded", { providerId: target.providerId, manifest: path });
@@ -2987,7 +2987,7 @@ async function logs(config: UniDeskConfig, name: string, target = ciTarget(null)
if (/^[a-z0-9]([-a-z0-9]{0,46}[a-z0-9])?$/u.test(name)) {
const runScript = remoteRunLogsScript(name, target, options);
const result = options.capture === "ssh-stream"
? await runSshCommandCapture(config, `${target.providerId}:k3s`, ["script"], runScript)
? await runSshCommandCapture(config, `${target.providerId}:k3s`, ["sh"], runScript)
: await dispatchSsh(runScript, 60_000, 45_000, true, target);
const resultOk = "ok" in result ? result.ok : result.exitCode === 0;
if (resultOk || (result.exitCode !== 42 && !result.stderr.includes("no_run_files="))) {
@@ -3006,7 +3006,7 @@ async function logs(config: UniDeskConfig, name: string, target = ciTarget(null)
}
const script = pipelineRunLogsScript(name, options);
const result = options.capture === "ssh-stream"
? await runSshCommandCapture(config, `${target.providerId}:k3s`, ["script"], script)
? await runSshCommandCapture(config, `${target.providerId}:k3s`, ["sh"], script)
: await runRemoteKubectl(script, 60_000, 45_000, target);
return ciLogsResultFromCapture({
ok: result.exitCode === 0,