mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
on Linux systems this is derived from the configure cpuset cgroup parent (defaults to /nomad) for non Linux systems and Linux systems where cgroups are not enabled, the client defaults to using all cores
14 lines
343 B
Go
14 lines
343 B
Go
package fingerprint
|
|
|
|
import (
|
|
"github.com/hashicorp/nomad/client/lib/cgutil"
|
|
)
|
|
|
|
func (f *CPUFingerprint) deriveReservableCores(req *FingerprintRequest, totalCores int) ([]uint16, error) {
|
|
if req.Config.DisableCgroupManagement {
|
|
return defaultReservableCores(totalCores), nil
|
|
}
|
|
return cgutil.GetCPUsFromCgroup(req.Config.CgroupParent)
|
|
|
|
}
|