fix: gate d601 v03 postgres mode by yaml switch (#972)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-26 14:01:49 +08:00
committed by GitHub
parent 0b923fc5ee
commit fc6d3bdaf9
8 changed files with 55 additions and 20 deletions
+6 -3
View File
@@ -31,6 +31,7 @@ import type { RenderedCliResult } from "../output";
import { NODE_RUNTIME_CICD_WAIT_WARNING_SECONDS } from "./entry";
import { publicExposureSummary } from "./public-exposure";
import { assertNodeId, positiveIntegerOption, requiredOption } from "./utils";
import { hwlabRuntimeActiveExternalPostgres } from "../hwlab-node-lanes";
export function parseNodeScopedDelegatedOptions(domain: DelegatedNodeDomain, args: string[]): {
domain: DelegatedNodeDomain;
@@ -76,10 +77,11 @@ export function parseNodeScopedDelegatedOptions(domain: DelegatedNodeDomain, arg
}
export function nodeRuntimeLocalPostgresExpectedAbsent(spec: HwlabRuntimeLaneSpec): boolean {
return spec.externalPostgres !== undefined || spec.runtimeStore?.postgres?.mode === "platform-service";
return spec.runtimeStore?.postgres?.mode === "platform-service";
}
export function nodeRuntimeExpected(spec: HwlabRuntimeLaneSpec): Record<string, unknown> {
const activeExternalPostgres = hwlabRuntimeActiveExternalPostgres(spec);
return {
configPath: hwlabRuntimeLaneConfigPath(),
node: spec.nodeId,
@@ -151,6 +153,7 @@ export function nodeRuntimeExpected(spec: HwlabRuntimeLaneSpec): Record<string,
observability: spec.observability,
runtimeImageRewrites: spec.runtimeImageRewrites,
externalPostgres: spec.externalPostgres === undefined ? null : {
active: activeExternalPostgres !== undefined,
provider: spec.externalPostgres.provider,
configRef: spec.externalPostgres.configRef,
serviceName: spec.externalPostgres.serviceName,
@@ -178,8 +181,8 @@ export function nodeRuntimeExpected(spec: HwlabRuntimeLaneSpec): Record<string,
valuesPrinted: false,
},
localPostgres: {
shouldRender: spec.externalPostgres === undefined,
expectedAbsent: spec.externalPostgres !== undefined,
shouldRender: spec.runtimeStore?.postgres?.mode !== "platform-service",
expectedAbsent: spec.runtimeStore?.postgres?.mode === "platform-service",
},
};
}