mirror of
https://github.com/traefik/traefik.git
synced 2026-06-09 00:32:27 -04:00
Downgrade log level for missing container on inspect
This commit is contained in:
parent
94764103c4
commit
210344f950
2 changed files with 7 additions and 2 deletions
2
go.mod
2
go.mod
|
|
@ -16,6 +16,7 @@ require (
|
|||
github.com/aws/aws-sdk-go-v2/service/ssm v1.56.13
|
||||
github.com/aws/smithy-go v1.24.0
|
||||
github.com/cenkalti/backoff/v4 v4.3.0
|
||||
github.com/containerd/errdefs v1.0.0
|
||||
github.com/containous/alice v0.0.0-20181107144136-d83ebdd94cbd // No tag on the repo.
|
||||
github.com/coreos/go-systemd/v22 v22.5.0
|
||||
github.com/docker/cli v29.2.1+incompatible
|
||||
|
|
@ -178,7 +179,6 @@ require (
|
|||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/clbanning/mxj/v2 v2.7.0 // indirect
|
||||
github.com/containerd/errdefs v1.0.0 // indirect
|
||||
github.com/containerd/errdefs/pkg v0.3.0 // indirect
|
||||
github.com/containerd/log v0.1.0 // indirect
|
||||
github.com/containerd/platforms v1.0.0-rc.1 // indirect
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/docker/cli/cli/connhelper"
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/client"
|
||||
|
|
@ -39,7 +40,11 @@ type Shared struct {
|
|||
func inspectContainers(ctx context.Context, dockerClient client.ContainerAPIClient, containerID string) dockerData {
|
||||
containerInspected, err := dockerClient.ContainerInspect(ctx, containerID)
|
||||
if err != nil {
|
||||
log.Ctx(ctx).Warn().Err(err).Msgf("Failed to inspect container %s", containerID)
|
||||
if errdefs.IsNotFound(err) {
|
||||
log.Ctx(ctx).Debug().Err(err).Msgf("Failed to inspect container %s", containerID)
|
||||
} else {
|
||||
log.Ctx(ctx).Warn().Err(err).Msgf("Failed to inspect container %s", containerID)
|
||||
}
|
||||
return dockerData{}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue