fix: sync parent app-of-apps before syncing customer app on upgrade
Some checks failed
Build & Release / build (push) Has been cancelled
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:
@@ -342,6 +342,7 @@ export async function customerRoutes(app: FastifyInstance) {
|
|||||||
if (!customer) return reply.code(404).send({ message: "Not found" });
|
if (!customer) return reply.code(404).send({ message: "Not found" });
|
||||||
const version = await getLatestChartVersion();
|
const version = await getLatestChartVersion();
|
||||||
await upgradeCustomerChart(slug, version);
|
await upgradeCustomerChart(slug, version);
|
||||||
|
await syncArgoApp("customers");
|
||||||
await syncArgoApp(`customer-${slug}`);
|
await syncArgoApp(`customer-${slug}`);
|
||||||
await db`UPDATE customers SET updated_at = NOW() WHERE slug = ${slug}`;
|
await db`UPDATE customers SET updated_at = NOW() WHERE slug = ${slug}`;
|
||||||
app.log.info({ slug, version }, "customer chart upgraded");
|
app.log.info({ slug, version }, "customer chart upgraded");
|
||||||
@@ -354,6 +355,7 @@ export async function customerRoutes(app: FastifyInstance) {
|
|||||||
const version = await getLatestChartVersion();
|
const version = await getLatestChartVersion();
|
||||||
const slugs = customers.map((c: any) => c.slug);
|
const slugs = customers.map((c: any) => c.slug);
|
||||||
await upgradeAllCustomerCharts(slugs, version);
|
await upgradeAllCustomerCharts(slugs, version);
|
||||||
|
await syncArgoApp("customers");
|
||||||
await Promise.all(slugs.map((s: string) => syncArgoApp(`customer-${s}`)));
|
await Promise.all(slugs.map((s: string) => syncArgoApp(`customer-${s}`)));
|
||||||
app.log.info({ slugs, version }, "all customers chart upgraded");
|
app.log.info({ slugs, version }, "all customers chart upgraded");
|
||||||
return reply.send({ upgraded: slugs, version });
|
return reply.send({ upgraded: slugs, version });
|
||||||
|
|||||||
Reference in New Issue
Block a user