From 637d49e1abbce13b572192e98d0888ec4e0d9127 Mon Sep 17 00:00:00 2001 From: jpic Date: Sun, 31 May 2020 02:45:24 +0200 Subject: [PATCH] Bugfix: legacy code would prevent containers from shuting down after build --- shlax/targets/buildah.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shlax/targets/buildah.py b/shlax/targets/buildah.py index 484ce35..b7d52ae 100644 --- a/shlax/targets/buildah.py +++ b/shlax/targets/buildah.py @@ -141,13 +141,9 @@ class Buildah(Target): async def clean(self, target): for src, dst in self.mounts.items(): await self.parent.exec('umount', self.root / str(dst)[1:]) - else: - return if self.result.status == 'success': await self.commit() - if os.getenv('BUILDAH_PUSH'): - await self.image.push(target) if self.root is not None: await self.parent.exec('buildah', 'umount', self.ctr) @@ -155,6 +151,10 @@ class Buildah(Target): if self.ctr is not None: await self.parent.exec('buildah', 'rm', self.ctr) + if self.result.status == 'success': + if os.getenv('BUILDAH_PUSH'): + await self.image.push(target) + async def mount(self, src, dst): """Mount a host directory into the container.""" target = self.root / str(dst)[1:]