From 467360954a2dd20de192664c53a5d3626f201af4 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Fri, 2 Nov 2018 10:31:23 -0400 Subject: [PATCH] driver/java: support non-linux targets Java driver supports non-linux targets, so LinuxResources fields isn't guaranteed to be not-nil. --- drivers/java/driver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/java/driver.go b/drivers/java/driver.go index f94a55c67..2d700ba51 100644 --- a/drivers/java/driver.go +++ b/drivers/java/driver.go @@ -326,8 +326,8 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *cstru User: cfg.User, ResourceLimits: true, Resources: &executor.Resources{ - CPU: int(cfg.Resources.LinuxResources.CPUShares), - MemoryMB: int(drivers.BytesToMB(cfg.Resources.LinuxResources.MemoryLimitBytes)), + CPU: cfg.Resources.NomadResources.CPU, + MemoryMB: cfg.Resources.NomadResources.MemoryMB, DiskMB: cfg.Resources.NomadResources.DiskMB, }, TaskDir: cfg.TaskDir().Dir,