fix(gitops): make local postgres image yaml-driven (#1959)
This commit is contained in:
@@ -5006,7 +5006,13 @@ function deviceAgent71FreqManifest({ profile = "dev", source, registryPrefix, ca
|
||||
};
|
||||
}
|
||||
|
||||
function v02PostgresManifest({ profile = "v02", migrationSql, source }) {
|
||||
function runtimePostgresImageForProfile(deploy, profile) {
|
||||
const postgres = runtimeLaneConfig(deploy, profile)?.runtimeStore?.postgres;
|
||||
const image = postgres && typeof postgres === "object" && !Array.isArray(postgres) ? postgres.image : null;
|
||||
return typeof image === "string" && image.trim().length > 0 ? image.trim() : "postgres:16-alpine";
|
||||
}
|
||||
|
||||
function v02PostgresManifest({ profile = "v02", migrationSql, source, image = "postgres:16-alpine" }) {
|
||||
const namespace = namespaceNameForProfile(profile);
|
||||
const name = `${namespace}-postgres`;
|
||||
const dbName = `hwlab_${profile}`;
|
||||
@@ -5057,7 +5063,7 @@ function v02PostgresManifest({ profile = "v02", migrationSql, source }) {
|
||||
spec: {
|
||||
containers: [{
|
||||
name: "postgres",
|
||||
image: "127.0.0.1:5000/hwlab/postgres:16-alpine",
|
||||
image,
|
||||
imagePullPolicy: "IfNotPresent",
|
||||
env: [
|
||||
{ name: "POSTGRES_DB", value: dbName },
|
||||
@@ -5466,7 +5472,7 @@ async function plannedFiles(args) {
|
||||
putJson(`${runtimePath}/workloads.yaml`, transformWorkloads({ workloads, deploy, catalog: artifactCatalog, source, sourceBranch: args.sourceBranch, gitReadUrl: args.gitReadUrl, registryPrefix: args.registryPrefix, runtimeEndpoint: endpoints.runtimeEndpoint, webEndpoint: endpoints.webEndpoint, profile, useDeployImages: args.useDeployImages, metricsSidecarSha256 }));
|
||||
putJson(`${runtimePath}/deepseek-proxy.yaml`, deepSeekProxyManifest({ profile, source, sourceBranch: args.sourceBranch, sourceRepo: args.sourceRepo, gitReadUrl: args.gitReadUrl, deploy, registryPrefix: args.registryPrefix, catalog: artifactCatalog, useDeployImages: args.useDeployImages, metricsSidecarSha256 }));
|
||||
if (isRuntimeLane(profile) && externalPostgres) putJson(`${runtimePath}/external-postgres.yaml`, externalPostgresManifest({ profile, config: externalPostgres, source }));
|
||||
if (isRuntimeLane(profile) && !externalPostgres) putJson(`${runtimePath}/postgres.yaml`, v02PostgresManifest({ profile, migrationSql, source }));
|
||||
if (isRuntimeLane(profile) && !externalPostgres) putJson(`${runtimePath}/postgres.yaml`, v02PostgresManifest({ profile, migrationSql, source, image: runtimePostgresImageForProfile(deploy, profile) }));
|
||||
if (workbenchRedis) putJson(`${runtimePath}/workbench-redis.yaml`, workbenchRuntimeRedisManifest({ profile, config: workbenchRedis, source }));
|
||||
if (isRuntimeLane(profile)) putJson(`${runtimePath}/openfga.yaml`, v02OpenFgaManifest({ profile, source }));
|
||||
if (isRuntimeLane(profile)) putJson(`${runtimePath}/observability.yaml`, observabilityManifest({ deploy, profile, namespace, labels: profileLabels, annotations, metricsSidecarScript }));
|
||||
|
||||
Reference in New Issue
Block a user