From cd44aba8db581d033de47bb9292e588f0d5b819d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 30 Jun 2023 18:28:55 +0200 Subject: [PATCH] [24.0] pkg/fileutils: switch to use containerd log pkg (very) partial backport of 74da6a6363d9d2991ea51ba44061a31a17b855cf and ab35df454d0666ef1214168938f952cc74c1d659 Signed-off-by: Sebastiaan van Stijn --- pkg/fileutils/fileutils_unix.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/fileutils/fileutils_unix.go b/pkg/fileutils/fileutils_unix.go index f782b4266a..ab8e03a9a0 100644 --- a/pkg/fileutils/fileutils_unix.go +++ b/pkg/fileutils/fileutils_unix.go @@ -1,20 +1,20 @@ //go:build linux || freebsd -// +build linux freebsd package fileutils // import "github.com/docker/docker/pkg/fileutils" import ( + "context" "fmt" "os" - "github.com/sirupsen/logrus" + "github.com/containerd/containerd/log" ) // GetTotalUsedFds Returns the number of used File Descriptors by // reading it via /proc filesystem. func GetTotalUsedFds() int { if fds, err := os.ReadDir(fmt.Sprintf("/proc/%d/fd", os.Getpid())); err != nil { - logrus.Errorf("Error opening /proc/%d/fd: %s", os.Getpid(), err) + log.G(context.TODO()).Errorf("Error opening /proc/%d/fd: %s", os.Getpid(), err) } else { return len(fds) }