fix: require explicit trans shell operations
This commit is contained in:
+3
-3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user