stage1: handle CPU isolator

This commit is contained in:
Iago López Galeiras
2015-06-03 14:28:14 +02:00
parent 9fb037d019
commit 52213ca754
+8
View File
@@ -254,6 +254,14 @@ func (p *Pod) appToSystemd(ra *schema.RuntimeApp, am *schema.ImageManifest, inte
case *types.ResourceMemory:
l := v.Limit().String()
opts = append(opts, newUnitOption("Service", "MemoryLimit", l))
case *types.ResourceCPU:
l := v.Limit().String()
milliCores, err := strconv.Atoi(l)
if err != nil {
return err
}
quota := strconv.Itoa(milliCores/10) + "%"
opts = append(opts, newUnitOption("Service", "CPUQuota", quota))
}
}