fix: render nc01 external postgres bridge
This commit is contained in:
@@ -5150,15 +5150,18 @@ function v02PostgresManifest({ profile = "v02", migrationSql, source, image = "p
|
||||
};
|
||||
}
|
||||
|
||||
function externalPostgresConfigForLane(deploy, profile) {
|
||||
function externalPostgresConfigForLane(deploy, profile, args = {}) {
|
||||
if (!isRuntimeLane(profile)) return null;
|
||||
const config = deploy?.lanes?.[profile]?.externalPostgres;
|
||||
if (!config || config.enabled !== true) return null;
|
||||
assert.ok(typeof config.serviceName === "string" && config.serviceName.length > 0, `deploy.lanes.${profile}.externalPostgres.serviceName is required`);
|
||||
assert.ok(typeof config.endpointAddress === "string" && config.endpointAddress.length > 0, `deploy.lanes.${profile}.externalPostgres.endpointAddress is required`);
|
||||
const port = Number(config.port ?? 5432);
|
||||
const nodeId = effectiveSecretPlaneNodeId(args);
|
||||
const nodeConfig = nodeId ? config?.nodes?.[nodeId] : null;
|
||||
const effective = nodeConfig && typeof nodeConfig === "object" && !Array.isArray(nodeConfig) ? { ...config, ...nodeConfig } : config;
|
||||
assert.ok(typeof effective.serviceName === "string" && effective.serviceName.length > 0, `deploy.lanes.${profile}.externalPostgres.serviceName is required`);
|
||||
assert.ok(typeof effective.endpointAddress === "string" && effective.endpointAddress.length > 0, `deploy.lanes.${profile}.externalPostgres.endpointAddress is required`);
|
||||
const port = Number(effective.port ?? 5432);
|
||||
assert.ok(Number.isInteger(port) && port > 0 && port <= 65535, `deploy.lanes.${profile}.externalPostgres.port must be a valid TCP port`);
|
||||
return { serviceName: config.serviceName, endpointAddress: config.endpointAddress, port };
|
||||
return { serviceName: effective.serviceName, endpointAddress: effective.endpointAddress, port };
|
||||
}
|
||||
|
||||
function externalPostgresManifest({ profile = "v03", config, source }) {
|
||||
@@ -5960,7 +5963,7 @@ async function plannedFiles(args) {
|
||||
for (const profile of profiles) {
|
||||
const namespace = namespaceNameForProfile(profile);
|
||||
const includeDeviceAgent = profile === "dev";
|
||||
const externalPostgres = externalPostgresConfigForLane(deploy, profile);
|
||||
const externalPostgres = externalPostgresConfigForLane(deploy, profile, args);
|
||||
const workbenchRedis = workbenchRuntimeRedisConfigForProfile(deploy, profile);
|
||||
const runtimeConfigMaps = runtimeConfigMapsForProfile(deploy, profile);
|
||||
const runtimeSecretPlane = await runtimeSecretPlaneConfigForProfile(deploy, profile, args);
|
||||
|
||||
Reference in New Issue
Block a user