From 095dc9ae57d80d3834aa8fcb6daf6cc2be29f5b9 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Tue, 6 Oct 2015 01:47:04 -0700 Subject: [PATCH] Updated Throttle Read/Write to match upstream changes in runc; now takes a list of ThrottleDevice structs instead of an int --- client/executor/exec_linux.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/executor/exec_linux.go b/client/executor/exec_linux.go index c837b8a531e..79812b75bc7 100644 --- a/client/executor/exec_linux.go +++ b/client/executor/exec_linux.go @@ -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) } }