Skip to content

Commit

Permalink
Don't orphan pods from deleted job
Browse files Browse the repository at this point in the history
  • Loading branch information
jmandel committed Sep 19, 2023
1 parent b3eb892 commit ce68023
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion triggers/ig-commit-trigger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ce68023

Please sign in to comment.