From ce6802319c69300dbeb504b9a19988b703e3b350 Mon Sep 17 00:00:00 2001 From: Josh Mandel Date: Tue, 19 Sep 2023 12:47:20 -0700 Subject: [PATCH] Don't orphan pods from deleted job --- triggers/ig-commit-trigger/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/triggers/ig-commit-trigger/index.js b/triggers/ig-commit-trigger/index.js index 00d62cd8..f70ea0a6 100644 --- a/triggers/ig-commit-trigger/index.js +++ b/triggers/ig-commit-trigger/index.js @@ -76,7 +76,7 @@ functions.http("ig-commit-trigger", async function (req, res) { const created = await k8sBatch.createNamespacedJob("fhir", job); console.log("Kill existing jobs", existing?.body?.items?.map(j => j?.metadata?.name)) - await Promise.all(existing?.body?.items?.map((i) => k8sBatch.deleteNamespacedJob(i.metadata.name, "fhir"))) + await Promise.all(existing?.body?.items?.map((i) => k8sBatch.deleteNamespacedJob(i.metadata.name, "fhir", undefined, undefined, 0, undefined, "Background"))) return res.status(200).json({ created: true,