Update cgroup CPU to use int comparison not float

This commit is contained in:
Alex Dadgar 2015-10-19 13:33:22 -07:00
parent 489b9a925b
commit c3fbce46b7

View file

@ -195,9 +195,9 @@ func (e *LinuxExecutor) configureCgroups(resources *structs.Resources) error {
e.groups.MemorySwap = int64(-1)
}
if resources.CPU > 0.0 {
if resources.CPU < 2.0 {
return fmt.Errorf("resources.CPU must be equal to or greater than 2.0: %v", resources.CPU)
if resources.CPU != 0 {
if resources.CPU < 2 {
return fmt.Errorf("resources.CPU must be equal to or greater than 2: %v", resources.CPU)
}
// Set the relative CPU shares for this cgroup.