Skip to content

Commit

Permalink
fix container creation when --reuse is given (#838)
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulchhabra99 committed May 22, 2020
1 parent 9bbbe33 commit 7a3b24e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cli/popper/runner_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,18 @@ def run(self, step):
cid = pu.sanitized_name(step.id, self._config.wid)

container = self._find_container(cid)

if not container and self._config.reuse:
log.fail(
f"Cannot find an existing container for step '{step.id}' to be reused"
)

if container and not self._config.reuse and not self._config.dry_run:
container.remove(force=True)
container = None

container = self._create_container(cid, step)
if not container and not self._config.reuse:
container = self._create_container(cid, step)

log.info(f"[{step.id}] docker start")

Expand Down

0 comments on commit 7a3b24e

Please sign in to comment.