From 8ca21c1dd4a6d392fd6f34e5ff93182039680e92 Mon Sep 17 00:00:00 2001 From: nicktrn <55853254+nicktrn@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:00:15 +0000 Subject: [PATCH] delete checkpoint archive after successful push --- apps/coordinator/src/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/coordinator/src/index.ts b/apps/coordinator/src/index.ts index 571ebaa01..2adffc4e3 100644 --- a/apps/coordinator/src/index.ts +++ b/apps/coordinator/src/index.ts @@ -216,7 +216,15 @@ class Checkpointer { // Push checkpoint image this.#logger.debug(await $`buildah push --tls-verify=${REGISTRY_TLS_VERIFY} ${imageRef}`); - this.#logger.log("checkpointed and pushed image to:", imageRef); + this.#logger.log("Checkpointed and pushed image to:", { location: imageRef }); + + try { + await $`rm ${exportLocation}`; + this.#logger.log("Deleted checkpoint archive", { exportLocation }); + } catch (error) { + this.#logger.error("Failed to delete checkpoint archive", { exportLocation }); + this.#logger.debug(error); + } return { location: imageRef,