Skip to content

Commit

Permalink
don't fail logs when driver:none is set
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Dec 20, 2022
1 parent 9f5f0b6 commit 5ed4bfc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/compose/logs.go
Expand Up @@ -22,7 +22,9 @@ import (
"strings"

"github.com/docker/docker/api/types"
"github.com/docker/docker/errdefs"
"github.com/docker/docker/pkg/stdcopy"
"github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"

"github.com/docker/compose/v2/pkg/api"
Expand Down Expand Up @@ -59,7 +61,12 @@ func (s *composeService) Logs(
for _, c := range containers {
c := c
eg.Go(func() error {
return s.logContainers(ctx, consumer, c, options)
err := s.logContainers(ctx, consumer, c, options)
if _, ok := err.(errdefs.ErrNotImplemented); ok {
logrus.Warnf("Can't retrieve logs for %q: %s", getCanonicalContainerName(c), err.Error())
return nil
}
return err
})
}

Expand All @@ -85,7 +92,10 @@ func (s *composeService) Logs(
Container: getContainerNameWithoutProject(c),
Service: c.Labels[api.ServiceLabel],
})
return s.logContainers(ctx, consumer, c, options)
eg.Go(func() error {
return s.logContainers(ctx, consumer, c, options)
})
return nil
})
printer.Stop()
return err
Expand Down

0 comments on commit 5ed4bfc

Please sign in to comment.