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:
parent
e64ef839b8
commit
467360954a
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue