mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 02:45:42 +03:00
tests: fix rkt command environment (#5011)
The environment variables needed for envoking `rkt` command line should include host PATH (to access `iptables`). Given that the command runs outside the VM, untrusted task environment variables should NOT be honored here. We do this already with `rkt`, but the change is quite subtle to miss when refactoring.
This commit is contained in:
@@ -661,10 +661,13 @@ func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *cstru
|
||||
Args: runArgs,
|
||||
ResourceLimits: true,
|
||||
Resources: cfg.Resources,
|
||||
Env: cfg.EnvList(),
|
||||
TaskDir: cfg.TaskDir().Dir,
|
||||
StdoutPath: cfg.StdoutPath,
|
||||
StderrPath: cfg.StderrPath,
|
||||
|
||||
// Use rktEnv, the environment needed for running rkt, not the task env
|
||||
Env: rktEnv.List(),
|
||||
|
||||
TaskDir: cfg.TaskDir().Dir,
|
||||
StdoutPath: cfg.StdoutPath,
|
||||
StderrPath: cfg.StderrPath,
|
||||
}
|
||||
ps, err := execImpl.Launch(execCmd)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user