feat: add JD01 YAML-first deployment support
This commit is contained in:
@@ -300,10 +300,11 @@ function agentRunRuntimeNamespaceManifest(spec: AgentRunLaneSpec): Record<string
|
||||
|
||||
function agentRunPostgresManifest(spec: AgentRunLaneSpec): Record<string, unknown> {
|
||||
const localPostgres = spec.deployment.localPostgres;
|
||||
if (!localPostgres.enabled || localPostgres.serviceName === null || localPostgres.image === null || localPostgres.storage === null || localPostgres.port === null) {
|
||||
if (!localPostgres.enabled || localPostgres.serviceName === null || localPostgres.image === null || localPostgres.storage === null || localPostgres.port === null || localPostgres.database === null || localPostgres.user === null) {
|
||||
throw new Error(`localPostgres is enabled for ${spec.version} without renderable YAML fields`);
|
||||
}
|
||||
const name = localPostgres.serviceName;
|
||||
const secretName = spec.database.secretRef.name;
|
||||
return {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
@@ -330,6 +331,13 @@ function agentRunPostgresManifest(spec: AgentRunLaneSpec): Record<string, unknow
|
||||
name: "postgres",
|
||||
image: localPostgres.image,
|
||||
ports: [{ name: "postgres", containerPort: localPostgres.port }],
|
||||
env: [
|
||||
{ name: "POSTGRES_DB", valueFrom: { secretKeyRef: { name: secretName, key: "POSTGRES_DB" } } },
|
||||
{ name: "POSTGRES_USER", valueFrom: { secretKeyRef: { name: secretName, key: "POSTGRES_USER" } } },
|
||||
{ name: "POSTGRES_PASSWORD", valueFrom: { secretKeyRef: { name: secretName, key: "POSTGRES_PASSWORD" } } },
|
||||
{ name: "PGDATA", value: "/var/lib/postgresql/data/pgdata" },
|
||||
],
|
||||
volumeMounts: [{ name: "data", mountPath: "/var/lib/postgresql/data" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user