From b662f672ba1115654a69f2ec68162cc001be9238 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Feb 2024 14:29:28 +0100 Subject: [PATCH] fix: ensure unused volumes are deleted Signed-off-by: Alex --- src/aap_eda/services/activation/engine/podman.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/aap_eda/services/activation/engine/podman.py b/src/aap_eda/services/activation/engine/podman.py index 3b1e38d5f..9b00cb1cf 100644 --- a/src/aap_eda/services/activation/engine/podman.py +++ b/src/aap_eda/services/activation/engine/podman.py @@ -100,6 +100,11 @@ def cleanup(self, container_id: str, log_handler: LogHandler) -> None: # ContainerCleanupError handled by the manager except APIError as e: raise exceptions.ContainerCleanupError(str(e)) from e + finally: + # Ensure volumes are purged due to a bug in podman + # ref: https://github.com/containers/podman-py/issues/328 + pruned_volumes = self.client.volumes.prune() + LOGGER.info(f"Pruned volumes: {pruned_volumes}") def _image_exists(self, image_url: str) -> bool: try: