From 471e0cb3c6a1fd15dc99aaa9d407399ce345e362 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 5 Apr 2026 16:43:03 +0000 Subject: [PATCH] fix: sync parent app-of-apps before syncing customer app on upgrade ArgoCD needs the customers app-of-apps to refresh first so it picks up the new targetRevision from the charts repo before syncing the child app. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/routes/customers.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/routes/customers.ts b/src/routes/customers.ts index 3ed5939..96bf3f6 100644 --- a/src/routes/customers.ts +++ b/src/routes/customers.ts @@ -342,6 +342,7 @@ export async function customerRoutes(app: FastifyInstance) { if (!customer) return reply.code(404).send({ message: "Not found" }); const version = await getLatestChartVersion(); await upgradeCustomerChart(slug, version); + await syncArgoApp("customers"); await syncArgoApp(`customer-${slug}`); await db`UPDATE customers SET updated_at = NOW() WHERE slug = ${slug}`; app.log.info({ slug, version }, "customer chart upgraded"); @@ -354,6 +355,7 @@ export async function customerRoutes(app: FastifyInstance) { const version = await getLatestChartVersion(); const slugs = customers.map((c: any) => c.slug); await upgradeAllCustomerCharts(slugs, version); + await syncArgoApp("customers"); await Promise.all(slugs.map((s: string) => syncArgoApp(`customer-${s}`))); app.log.info({ slugs, version }, "all customers chart upgraded"); return reply.send({ upgraded: slugs, version });