fix(hwlab-cli): report node provider offline in status (#757)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -3214,11 +3214,13 @@ function nodeRuntimeGitMirrorStatus(scoped: ReturnType<typeof parseNodeScopedDel
|
||||
"NODE",
|
||||
].join("\n");
|
||||
const result = runNodeK3sScript(spec, script, scoped.timeoutSeconds);
|
||||
const parsed = parseJsonObject(statusText(result));
|
||||
const parsed = record(parseJsonObject(statusText(result)));
|
||||
const summary = record(parsed.summary);
|
||||
const resources = record(parsed.resources);
|
||||
const githubTransport = record(parsed.githubTransport);
|
||||
const ok = result.exitCode === 0 && parsed.ok === true;
|
||||
const remoteText = `${result.stderr ?? ""}\n${result.stdout ?? ""}`;
|
||||
const remoteUnavailable = /provider is not online|UNIDESK_SSH_PROVIDER_OFFLINE|ssh.*unreachable/iu.test(remoteText);
|
||||
return {
|
||||
ok,
|
||||
command: `hwlab nodes git-mirror status --node ${scoped.node} --lane ${scoped.lane}`,
|
||||
@@ -3236,7 +3238,7 @@ function nodeRuntimeGitMirrorStatus(scoped: ReturnType<typeof parseNodeScopedDel
|
||||
summary,
|
||||
refSources: nodeRuntimeGitMirrorRefSources(scoped, mirror),
|
||||
result: compactRuntimeCommand(result),
|
||||
degradedReason: ok ? undefined : "node-runtime-git-mirror-not-ready",
|
||||
degradedReason: ok ? undefined : remoteUnavailable ? "node-provider-unavailable" : "node-runtime-git-mirror-not-ready",
|
||||
valuesPrinted: false,
|
||||
next: {
|
||||
sync: `bun scripts/cli.ts hwlab nodes git-mirror sync --node ${scoped.node} --lane ${scoped.lane} --confirm`,
|
||||
|
||||
Reference in New Issue
Block a user