From 0be9d7d77a3c66239fe35bdaecdcbc910ceddbb2 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Jul 2026 23:41:47 +0200 Subject: [PATCH] fix: order external PostgreSQL migration resources --- scripts/gitops-render.test.ts | 1 + scripts/src/gitops-render/runtime-manifests.mjs | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/gitops-render.test.ts b/scripts/gitops-render.test.ts index 5ce4f333..d265c2b3 100644 --- a/scripts/gitops-render.test.ts +++ b/scripts/gitops-render.test.ts @@ -735,6 +735,7 @@ test("v03 render keeps node identity as data instead of generated structure", as Object.keys(externalPostgresMigrationConfig?.data ?? {}).filter((name) => name.endsWith(".sql")), CLOUD_CORE_MIGRATIONS.map((migration) => path.basename(migration.path)) ); + assert.equal(externalPostgresMigrationConfig?.metadata?.annotations?.["argocd.argoproj.io/sync-wave"], "-2"); assert.equal(externalPostgresMigrationJob?.metadata?.annotations?.["argocd.argoproj.io/sync-wave"], "-1"); assert.equal( externalPostgresMigrationJob?.spec?.template?.spec?.containers?.[0]?.image, diff --git a/scripts/src/gitops-render/runtime-manifests.mjs b/scripts/src/gitops-render/runtime-manifests.mjs index 09889826..4e019f3c 100644 --- a/scripts/src/gitops-render/runtime-manifests.mjs +++ b/scripts/src/gitops-render/runtime-manifests.mjs @@ -775,7 +775,16 @@ function externalPostgresManifest({ profile = "v03", config, source, deploy = nu { apiVersion: "v1", kind: "ConfigMap", - metadata: { name: migrationName, namespace, labels, annotations: { ...annotations, "hwlab.pikastech.local/migration-sha256": migrationSha256 } }, + metadata: { + name: migrationName, + namespace, + labels, + annotations: { + ...annotations, + "argocd.argoproj.io/sync-wave": "-2", + "hwlab.pikastech.local/migration-sha256": migrationSha256 + } + }, data: { "run.mjs": migrationRunner, ...migrationData