Merge pull request #10181 from laurazard/fix-log-f
Fix issue where `compose logs` doesn't exit when all running containers have been stopped
This commit is contained in:
commit
a2899d5ff0
@ -99,6 +99,12 @@ func isService(services ...string) containerPredicate {
|
||||
}
|
||||
}
|
||||
|
||||
func isRunning() containerPredicate {
|
||||
return func(c moby.Container) bool {
|
||||
return c.State == "running"
|
||||
}
|
||||
}
|
||||
|
||||
func isNotService(services ...string) containerPredicate {
|
||||
return func(c moby.Container) bool {
|
||||
service := c.Labels[api.ServiceLabel]
|
||||
|
@ -72,6 +72,7 @@ func (s *composeService) Logs(
|
||||
}
|
||||
|
||||
if options.Follow {
|
||||
containers = containers.filter(isRunning())
|
||||
printer := newLogPrinter(consumer)
|
||||
eg.Go(func() error {
|
||||
_, err := printer.Run(false, "", nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user