diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-07-12 06:22:27 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2023-07-14 07:37:23 +0300 |
commit | 46d97bc2f62cf7310a8bc6cdbf08c3cb9fad4da0 (patch) | |
tree | 56caf57c80cd3e366b07438223b3d44d9643bc2f | |
parent | 72a1553cb607f52e87a60977a9f04cc51d4542c4 (diff) |
Fix cgroup's MacOS-specific linter failures
In https://gitlab.com/gitlab-org/gitaly/-/merge_requests/5547, we
added the support for CgroupV2. It also introduced some linting
offenses on MacOS. They are mostly about unused functions or types. On
Linux, everything is fine. But on MacOS, files with specific build tags
are not included.
-rw-r--r-- | internal/cgroups/manager.go | 8 | ||||
-rw-r--r-- | internal/cgroups/metrics_linux.go (renamed from internal/cgroups/metrics.go) | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/cgroups/manager.go b/internal/cgroups/manager.go index 445138394..60971566a 100644 --- a/internal/cgroups/manager.go +++ b/internal/cgroups/manager.go @@ -5,13 +5,11 @@ package cgroups import ( log "github.com/sirupsen/logrus" "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config/cgroups" - cgroupscfg "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config/cgroups" ) -func newCgroupManager(cfg cgroupscfg.Config, pid int) Manager { +func newCgroupManager(_ cgroups.Config, _ int) Manager { return &NoopManager{} } -func pruneOldCgroups(cfg cgroups.Config, logger log.FieldLogger) { - return -} +// No-op. The actual pruning operations are implemented in Cgroup V1/V2 managers. +func pruneOldCgroups(_ cgroups.Config, _ log.FieldLogger) {} diff --git a/internal/cgroups/metrics.go b/internal/cgroups/metrics_linux.go index a8ffa618f..77a487e6b 100644 --- a/internal/cgroups/metrics.go +++ b/internal/cgroups/metrics_linux.go @@ -1,3 +1,5 @@ +//go:build linux + package cgroups import "github.com/prometheus/client_golang/prometheus" |