Attach to a container's log_stream before they're started
So we're not displaying output of all previous logs for a container, we attach, if possible, to a container before the container is started. LogPrinter checks if a container has a log_stream already attached and print from that rather than always attempting to attach one itself. Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
a4b002a76e
commit
7603ebea9b
6 changed files with 66 additions and 27 deletions
|
|
@ -18,6 +18,7 @@ from compose.service import ConvergenceStrategy
|
|||
class ProjectTestCase(DockerClientTestCase):
|
||||
def run_up(self, cfg, **kwargs):
|
||||
kwargs.setdefault('timeout', 1)
|
||||
kwargs.setdefault('detached', True)
|
||||
|
||||
project = self.make_project(cfg)
|
||||
project.up(**kwargs)
|
||||
|
|
@ -184,7 +185,8 @@ def converge(service,
|
|||
do_build=True):
|
||||
"""Create a converge plan from a strategy and execute the plan."""
|
||||
plan = service.convergence_plan(strategy)
|
||||
return service.execute_convergence_plan(plan, do_build=do_build, timeout=1)
|
||||
containers, logging_threads = zip(*service.execute_convergence_plan(plan, do_build=do_build, timeout=1))
|
||||
return containers
|
||||
|
||||
|
||||
class ServiceStateTest(DockerClientTestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue