From d5512c39f02cbe2f940a50f2ef52497631646efb Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 18 Dec 2018 15:10:13 -0800 Subject: [PATCH] Lint --- client/allocrunner/taskrunner/task_runner.go | 4 ++-- drivers/shared/executor/executor_linux.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/allocrunner/taskrunner/task_runner.go b/client/allocrunner/taskrunner/task_runner.go index c72ed4c5a..826e34480 100644 --- a/client/allocrunner/taskrunner/task_runner.go +++ b/client/allocrunner/taskrunner/task_runner.go @@ -706,8 +706,8 @@ func (tr *TaskRunner) buildTaskConfig() *drivers.TaskConfig { Resources: &drivers.Resources{ NomadResources: taskResources, LinuxResources: &drivers.LinuxResources{ - MemoryLimitBytes: int64(taskResources.Memory.MemoryMB) * 1024 * 1024, - CPUShares: int64(taskResources.Cpu.CpuShares), + MemoryLimitBytes: taskResources.Memory.MemoryMB * 1024 * 1024, + CPUShares: taskResources.Cpu.CpuShares, PercentTicks: float64(taskResources.Cpu.CpuShares) / float64(tr.clientConfig.Node.NodeResources.Cpu.CpuShares), }, }, diff --git a/drivers/shared/executor/executor_linux.go b/drivers/shared/executor/executor_linux.go index 83f405f8e..9a06e1140 100644 --- a/drivers/shared/executor/executor_linux.go +++ b/drivers/shared/executor/executor_linux.go @@ -580,7 +580,7 @@ func configureCgroups(cfg *lconfigs.Config, command *ExecCommand) error { if mb := command.Resources.NomadResources.Memory.MemoryMB; mb > 0 { // Total amount of memory allowed to consume - cfg.Cgroups.Resources.Memory = int64(mb * 1024 * 1024) + cfg.Cgroups.Resources.Memory = mb * 1024 * 1024 // Disable swap to avoid issues on the machine var memSwappiness uint64 cfg.Cgroups.Resources.MemorySwappiness = &memSwappiness