From d94e301219a93de7bbab72918cb60386cf3d6a59 Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Thu, 26 Sep 2019 16:19:27 -0400 Subject: [PATCH] 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. --- drivers/java/driver.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/java/driver.go b/drivers/java/driver.go index c4e08ca48..4d10f0e66 100644 --- a/drivers/java/driver.go +++ b/drivers/java/driver.go @@ -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)