Merge pull request #9016 from djdongjin/remove-most-logrus

Remove most logrus import
This commit is contained in:
Akihiro Suda
2023-09-05 16:09:12 +09:00
committed by GitHub
31 changed files with 84 additions and 94 deletions

View File

@@ -29,7 +29,6 @@ import (
"github.com/containerd/containerd/pkg/kmutex"
"github.com/containerd/containerd/reference/docker"
imagedigest "github.com/opencontainers/go-digest"
"github.com/sirupsen/logrus"
)
type CRIImageService struct {
@@ -64,7 +63,7 @@ func NewService(config criconfig.Config, imageFSPath string, client *containerd.
}
// Start snapshot stats syncer, it doesn't need to be stopped.
logrus.Info("Start snapshots syncer")
log.L.Info("Start snapshots syncer")
snapshotsSyncer := newSnapshotsSyncer(
svc.snapshotStore,
svc.client.SnapshotService(svc.config.ContainerdConfig.Snapshotter),

View File

@@ -33,7 +33,6 @@ import (
ctrdutil "github.com/containerd/containerd/pkg/cri/util"
"github.com/containerd/containerd/reference/docker"
runtimespec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
imagedigest "github.com/opencontainers/go-digest"
)
@@ -111,7 +110,7 @@ func buildLabels(configLabels, imageConfigLabels map[string]string, containerTyp
} else {
// In case the image label is invalid, we output a warning and skip adding it to the
// container.
logrus.WithError(err).Warnf("unable to add image label with key %s to the container", k)
log.L.WithError(err).Warnf("unable to add image label with key %s to the container", k)
}
}
// labels from the CRI request (config) will override labels in the image config

View File

@@ -22,10 +22,9 @@ import (
"syscall"
"time"
"github.com/sirupsen/logrus"
eventtypes "github.com/containerd/containerd/api/events"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/log"
sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
ctrdutil "github.com/containerd/containerd/pkg/cri/util"
"github.com/containerd/containerd/protobuf"
@@ -98,7 +97,7 @@ func (c *Controller) stopSandboxContainer(ctx context.Context, sandbox sandboxst
ExitStatus: exitStatus,
ExitedAt: protobuf.ToTimestamp(exitedAt),
}
logrus.WithError(err).Errorf("Failed to wait sandbox exit %+v", e)
log.G(ctx).WithError(err).Errorf("Failed to wait sandbox exit %+v", e)
// TODO: how to backoff
c.cri.BackOffEvent(id, e)
}