Bugfix: legacy code would prevent containers from shuting down after build

This commit is contained in:
jpic 2020-05-31 02:45:24 +02:00
parent ea4be19a86
commit 637d49e1ab

View File

@ -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:]