mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
CI: make make check clean on macOS (#14528)
Running `make check` on macOS identifies some dead code because the code is used only with the Linux build tag. Move this code into appropriately-tagged code files.
This commit is contained in:
@@ -8,8 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
cgroupAvailable = "available"
|
||||
cgroupUnavailable = "unavailable"
|
||||
cgroupUnavailable = "unavailable" // "available" is over in cgroup_linux
|
||||
|
||||
cgroupMountPointAttribute = "unique.cgroup.mountpoint"
|
||||
cgroupVersionAttribute = "unique.cgroup.version"
|
||||
|
||||
@@ -6,6 +6,10 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
cgroupAvailable = "available"
|
||||
)
|
||||
|
||||
// Fingerprint tries to find a valid cgroup mount point and the version of cgroups
|
||||
// if a mount-point is present.
|
||||
func (f *CGroupFingerprint) Fingerprint(req *FingerprintRequest, resp *FingerprintResponse) error {
|
||||
|
||||
@@ -2,7 +2,6 @@ package cgutil
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -61,18 +60,6 @@ type TaskCgroupInfo struct {
|
||||
Error error
|
||||
}
|
||||
|
||||
// identity is the "<allocID>.<taskName>" string that uniquely identifies an
|
||||
// individual instance of a task within the flat cgroup namespace
|
||||
type identity string
|
||||
|
||||
func makeID(allocID, task string) identity {
|
||||
return identity(fmt.Sprintf("%s.%s", allocID, task))
|
||||
}
|
||||
|
||||
func makeScope(id identity) string {
|
||||
return string(id) + ".scope"
|
||||
}
|
||||
|
||||
// SplitPath determines the parent and cgroup from p.
|
||||
// p must contain at least 2 elements (parent + cgroup).
|
||||
//
|
||||
|
||||
@@ -4,6 +4,7 @@ package cgutil
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -314,3 +315,15 @@ func getCPUsFromCgroupV2(group string) ([]uint16, error) {
|
||||
}
|
||||
return set.ToSlice(), nil
|
||||
}
|
||||
|
||||
// identity is the "<allocID>.<taskName>" string that uniquely identifies an
|
||||
// individual instance of a task within the flat cgroup namespace
|
||||
type identity string
|
||||
|
||||
func makeID(allocID, task string) identity {
|
||||
return identity(fmt.Sprintf("%s.%s", allocID, task))
|
||||
}
|
||||
|
||||
func makeScope(id identity) string {
|
||||
return string(id) + ".scope"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user