driver/java: support non-linux targets

Java driver supports non-linux targets, so LinuxResources fields isn't
guaranteed to be not-nil.
This commit is contained in:
Mahmood Ali 2018-11-02 10:31:23 -04:00
parent e64ef839b8
commit 467360954a
1 changed files with 2 additions and 2 deletions

View File

@ -326,8 +326,8 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *cstru
User: cfg.User, User: cfg.User,
ResourceLimits: true, ResourceLimits: true,
Resources: &executor.Resources{ Resources: &executor.Resources{
CPU: int(cfg.Resources.LinuxResources.CPUShares), CPU: cfg.Resources.NomadResources.CPU,
MemoryMB: int(drivers.BytesToMB(cfg.Resources.LinuxResources.MemoryLimitBytes)), MemoryMB: cfg.Resources.NomadResources.MemoryMB,
DiskMB: cfg.Resources.NomadResources.DiskMB, DiskMB: cfg.Resources.NomadResources.DiskMB,
}, },
TaskDir: cfg.TaskDir().Dir, TaskDir: cfg.TaskDir().Dir,