mirror of
https://github.com/docker/compose.git
synced 2025-09-25 10:47:54 +02:00
use errdefs.IsNotImplemented to check if the logging is not implemented
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
parent
29630f184e
commit
8e57362a0f
@ -18,12 +18,11 @@ package compose
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/containerd/errdefs"
|
||||||
"github.com/docker/docker/api/types/container"
|
"github.com/docker/docker/api/types/container"
|
||||||
"github.com/docker/docker/errdefs"
|
|
||||||
"github.com/docker/docker/pkg/stdcopy"
|
"github.com/docker/docker/pkg/stdcopy"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
@ -64,8 +63,7 @@ func (s *composeService) Logs(
|
|||||||
for _, ctr := range containers {
|
for _, ctr := range containers {
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
err := s.logContainers(ctx, consumer, ctr, options)
|
err := s.logContainers(ctx, consumer, ctr, options)
|
||||||
var notImplErr errdefs.ErrNotImplemented
|
if errdefs.IsNotImplemented(err) {
|
||||||
if errors.As(err, ¬ImplErr) {
|
|
||||||
logrus.Warnf("Can't retrieve logs for %q: %s", getCanonicalContainerName(ctr), err.Error())
|
logrus.Warnf("Can't retrieve logs for %q: %s", getCanonicalContainerName(ctr), err.Error())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -106,8 +104,7 @@ func (s *composeService) Logs(
|
|||||||
Tail: options.Tail,
|
Tail: options.Tail,
|
||||||
Timestamps: options.Timestamps,
|
Timestamps: options.Timestamps,
|
||||||
})
|
})
|
||||||
var notImplErr errdefs.ErrNotImplemented
|
if errdefs.IsNotImplemented(err) {
|
||||||
if errors.As(err, ¬ImplErr) {
|
|
||||||
// ignore
|
// ignore
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user