Merge pull request #1587 from nak3/rkt-fix4
rkt.driver: Fix wrong MB calculation
This commit is contained in:
commit
44e7075087
|
@ -39,9 +39,6 @@ const (
|
||||||
// version to maintain an uniform interface across all drivers
|
// version to maintain an uniform interface across all drivers
|
||||||
minRktVersion = "0.14.0"
|
minRktVersion = "0.14.0"
|
||||||
|
|
||||||
// bytesToMB is the conversion from bytes to megabytes.
|
|
||||||
bytesToMB = 1024 * 1024
|
|
||||||
|
|
||||||
// The key populated in the Node Attributes to indicate the presence of the
|
// The key populated in the Node Attributes to indicate the presence of the
|
||||||
// Rkt driver
|
// Rkt driver
|
||||||
rktDriverAttr = "driver.rkt"
|
rktDriverAttr = "driver.rkt"
|
||||||
|
@ -241,7 +238,7 @@ func (d *RktDriver) Start(ctx *ExecContext, task *structs.Task) (DriverHandle, e
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add memory isolator
|
// Add memory isolator
|
||||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--memory=%vM", int64(task.Resources.MemoryMB)*bytesToMB))
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--memory=%vM", int64(task.Resources.MemoryMB)))
|
||||||
|
|
||||||
// Add CPU isolator
|
// Add CPU isolator
|
||||||
cmdArgs = append(cmdArgs, fmt.Sprintf("--cpu=%vm", int64(task.Resources.CPU)))
|
cmdArgs = append(cmdArgs, fmt.Sprintf("--cpu=%vm", int64(task.Resources.CPU)))
|
||||||
|
|
Loading…
Reference in a new issue