Updated Throttle Read/Write to match upstream changes in runc; now takes a list of ThrottleDevice structs instead of an int

This commit is contained in:
Chris Bednarski 2015-10-06 01:47:04 -07:00 committed by Alex Dadgar
parent 7e11f4fcca
commit ef3af6996b
1 changed files with 5 additions and 2 deletions

View File

@ -205,8 +205,11 @@ func (e *LinuxExecutor) configureCgroups(resources *structs.Resources) {
}
if resources.IOPS > 0 {
e.groups.BlkioThrottleReadIOpsDevice = strconv.FormatInt(int64(resources.IOPS), 10)
e.groups.BlkioThrottleWriteIOpsDevice = strconv.FormatInt(int64(resources.IOPS), 10)
throttleDevice := &cgroupConfig.ThrottleDevice{
Rate: uint64(resources.IOPS),
}
e.groups.BlkioThrottleReadIOPSDevice = append(e.groups.BlkioThrottleReadIOPSDevice, throttleDevice)
e.groups.BlkioThrottleWriteIOPSDevice = append(e.groups.BlkioThrottleWriteIOPSDevice, throttleDevice)
}
}