fix: sync parent app-of-apps before syncing customer app on upgrade
Some checks failed
Build & Release / build (push) Has been cancelled

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) <noreply@anthropic.com>
This commit is contained in:
ryan
2026-04-05 16:43:03 +00:00
parent afdae0be98
commit 471e0cb3c6

View File

@@ -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 });