driver/java: pass task network isolation to executor

Without passing the network isolation configuration to the executor,
java tasks are not placed in the same network namespace as the other
processes in their task group, which breaks Consul Connect.
This commit is contained in:
Tim Gross
2019-09-26 16:19:27 -04:00
parent 38cb49dd3e
commit d94e301219

View File

@@ -344,17 +344,18 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drive
}
execCmd := &executor.ExecCommand{
Cmd: absPath,
Args: args,
Env: cfg.EnvList(),
User: user,
ResourceLimits: true,
Resources: cfg.Resources,
TaskDir: cfg.TaskDir().Dir,
StdoutPath: cfg.StdoutPath,
StderrPath: cfg.StderrPath,
Mounts: cfg.Mounts,
Devices: cfg.Devices,
Cmd: absPath,
Args: args,
Env: cfg.EnvList(),
User: user,
ResourceLimits: true,
Resources: cfg.Resources,
TaskDir: cfg.TaskDir().Dir,
StdoutPath: cfg.StdoutPath,
StderrPath: cfg.StderrPath,
Mounts: cfg.Mounts,
Devices: cfg.Devices,
NetworkIsolation: cfg.NetworkIsolation,
}
ps, err := exec.Launch(execCmd)