This commit is contained in:
@@ -604,6 +604,25 @@
|
|||||||
"required": ["enabled", "serviceName", "endpointAddress", "port"],
|
"required": ["enabled", "serviceName", "endpointAddress", "port"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"enabled": { "type": "boolean" },
|
"enabled": { "type": "boolean" },
|
||||||
|
"serviceName": {
|
||||||
|
"type": "string",
|
||||||
|
"minLength": 1,
|
||||||
|
"maxLength": 63,
|
||||||
|
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
|
||||||
|
},
|
||||||
|
"endpointAddress": { "type": "string", "minLength": 1 },
|
||||||
|
"port": { "type": "integer", "minimum": 1, "maximum": 65535 },
|
||||||
|
"nodes": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": { "$ref": "#/$defs/externalPostgresNodeOverride" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"externalPostgresNodeOverride": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["serviceName", "endpointAddress", "port"],
|
||||||
|
"properties": {
|
||||||
"serviceName": {
|
"serviceName": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
|
|||||||
@@ -384,6 +384,11 @@ lanes:
|
|||||||
serviceName: jd01-pk01-platform-postgres
|
serviceName: jd01-pk01-platform-postgres
|
||||||
endpointAddress: 82.156.23.220
|
endpointAddress: 82.156.23.220
|
||||||
port: 5432
|
port: 5432
|
||||||
|
nodes:
|
||||||
|
NC01:
|
||||||
|
serviceName: nc01-host-postgres
|
||||||
|
endpointAddress: 10.42.0.1
|
||||||
|
port: 5432
|
||||||
runtimeStore:
|
runtimeStore:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
|
|||||||
@@ -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;
|
if (!isRuntimeLane(profile)) return null;
|
||||||
const config = deploy?.lanes?.[profile]?.externalPostgres;
|
const config = deploy?.lanes?.[profile]?.externalPostgres;
|
||||||
if (!config || config.enabled !== true) return null;
|
if (!config || config.enabled !== true) return null;
|
||||||
assert.ok(typeof config.serviceName === "string" && config.serviceName.length > 0, `deploy.lanes.${profile}.externalPostgres.serviceName is required`);
|
const nodeId = effectiveSecretPlaneNodeId(args);
|
||||||
assert.ok(typeof config.endpointAddress === "string" && config.endpointAddress.length > 0, `deploy.lanes.${profile}.externalPostgres.endpointAddress is required`);
|
const nodeConfig = nodeId ? config?.nodes?.[nodeId] : null;
|
||||||
const port = Number(config.port ?? 5432);
|
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`);
|
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 }) {
|
function externalPostgresManifest({ profile = "v03", config, source }) {
|
||||||
@@ -5960,7 +5963,7 @@ async function plannedFiles(args) {
|
|||||||
for (const profile of profiles) {
|
for (const profile of profiles) {
|
||||||
const namespace = namespaceNameForProfile(profile);
|
const namespace = namespaceNameForProfile(profile);
|
||||||
const includeDeviceAgent = profile === "dev";
|
const includeDeviceAgent = profile === "dev";
|
||||||
const externalPostgres = externalPostgresConfigForLane(deploy, profile);
|
const externalPostgres = externalPostgresConfigForLane(deploy, profile, args);
|
||||||
const workbenchRedis = workbenchRuntimeRedisConfigForProfile(deploy, profile);
|
const workbenchRedis = workbenchRuntimeRedisConfigForProfile(deploy, profile);
|
||||||
const runtimeConfigMaps = runtimeConfigMapsForProfile(deploy, profile);
|
const runtimeConfigMaps = runtimeConfigMapsForProfile(deploy, profile);
|
||||||
const runtimeSecretPlane = await runtimeSecretPlaneConfigForProfile(deploy, profile, args);
|
const runtimeSecretPlane = await runtimeSecretPlaneConfigForProfile(deploy, profile, args);
|
||||||
|
|||||||
Reference in New Issue
Block a user