diff --git a/pkg/snapshot/diskquota/prjquota.go b/pkg/snapshot/diskquota/prjquota.go index 004a1571..ef0f0db8 100644 --- a/pkg/snapshot/diskquota/prjquota.go +++ b/pkg/snapshot/diskquota/prjquota.go @@ -27,9 +27,8 @@ import ( "strings" "sync" - "github.com/sirupsen/logrus" - "github.com/containerd/containerd/v2/core/mount" + "github.com/containerd/log" "github.com/docker/go-units" ) @@ -145,7 +144,7 @@ func (quota *PrjQuotaDriver) setQuota(quotaID uint32, blockLimit uint64, mountPo blockLimitStr := strconv.FormatUint(blockLimit, 10) // ext4 set project quota limit - // logrus.Infof("setquota -P %s 0 %s 0 0 %s", quotaIDStr, blockLimitStr, mountPoint) + // log.L.Infof("setquota -P %s 0 %s 0 0 %s", quotaIDStr, blockLimitStr, mountPoint) stdout, stderr, err := ExecSync("setquota", "-P", quotaIDStr, "0", blockLimitStr, "0", "0", mountPoint) if err != nil { return fmt.Errorf("failed to set quota, mountpoint: (%s), quota id: (%d), quota: (%d kbytes), stdout: (%s), stderr: (%s): %w", @@ -203,7 +202,7 @@ func (quota *PrjQuotaDriver) GetNextQuotaID() (quotaID uint32, err error) { if id <= QuotaMaxID { break } - logrus.Infof("reach the maximum, try to reuse quotaID") + log.L.Infof("reach the maximum, try to reuse quotaID") quota.QuotaIDs, quota.LastID, err = loadQuotaIDs("-Pan") if err != nil { return 0, fmt.Errorf("failed to load quota list: %w", err) @@ -227,7 +226,7 @@ func (quota *PrjQuotaDriver) SetFileAttr(dir string, quotaID uint32) error { if err != nil { return fmt.Errorf("failed to set file(%s) quota id(%s), stdout: (%s), stderr: (%s): %w", dir, strID, stdout, stderr, err) } - logrus.Debugf("set quota id (%s) to file (%s) attr", strID, dir) + log.L.Debugf("set quota id (%s) to file (%s) attr", strID, dir) return nil } diff --git a/pkg/snapshot/overlay.go b/pkg/snapshot/overlay.go index 057fc398..ff4528a3 100644 --- a/pkg/snapshot/overlay.go +++ b/pkg/snapshot/overlay.go @@ -36,7 +36,6 @@ import ( mylog "github.com/containerd/accelerated-container-image/internal/log" "github.com/containerd/accelerated-container-image/pkg/metrics" "github.com/data-accelerator/zdfs" - "github.com/sirupsen/logrus" "github.com/containerd/containerd/v2/core/mount" "github.com/containerd/containerd/v2/core/snapshots" @@ -249,7 +248,7 @@ func NewSnapshotter(bootConfig *BootConfig, opts ...Opt) (snapshots.Snapshotter, } if bootConfig.MirrorRegistry != nil { - logrus.Infof("mirror Registry: %+v", bootConfig.MirrorRegistry) + log.L.Infof("mirror Registry: %+v", bootConfig.MirrorRegistry) } return &snapshotter{ @@ -679,7 +678,7 @@ func (o *snapshotter) Prepare(ctx context.Context, key, parent string, opts ...s if retErr != nil { metrics.GRPCErrCount.WithLabelValues("Prepare").Inc() } else { - log.G(ctx).WithFields(logrus.Fields{ + log.G(ctx).WithFields(log.Fields{ "d": time.Since(start), "key": key, "parent": parent, @@ -717,7 +716,7 @@ func (o *snapshotter) Mounts(ctx context.Context, key string) (_ []mount.Mount, if retErr != nil { metrics.GRPCErrCount.WithLabelValues("Mounts").Inc() } else { - log.G(ctx).WithFields(logrus.Fields{ + log.G(ctx).WithFields(log.Fields{ "d": time.Since(start), "key": key, }).Infof("Mounts") @@ -792,7 +791,7 @@ func (o *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap if retErr != nil { metrics.GRPCErrCount.WithLabelValues("Commit").Inc() } else { - log.G(ctx).WithFields(logrus.Fields{ + log.G(ctx).WithFields(log.Fields{ "d": time.Since(start), "name": name, "key": key, diff --git a/pkg/snapshot/storage.go b/pkg/snapshot/storage.go index 0b9c2328..d89fa8ac 100644 --- a/pkg/snapshot/storage.go +++ b/pkg/snapshot/storage.go @@ -46,7 +46,6 @@ import ( "github.com/containerd/log" "github.com/moby/sys/mountinfo" specs "github.com/opencontainers/image-spec/specs-go/v1" - "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -135,7 +134,7 @@ func (o *snapshotter) parseAndCheckMounted(ctx context.Context, r io.Reader, mat numFields := len(fields) if numFields < 10 { // should be at least 10 fields - logrus.Warnf("Parsing '%s' failed: not enough fields (%d)", text, numFields) + log.G(ctx).Warnf("Parsing '%s' failed: not enough fields (%d)", text, numFields) continue }