open-nomad/drivers/shared
Tim Gross eabbcebdd4
exec: allow running commands from host volume (#14851)
The exec driver and other drivers derived from the shared executor check the
path of the command before handing off to libcontainer to ensure that the
command doesn't escape the sandbox. But we don't check any host volume mounts,
which should be safe to use as a source for executables if we're letting the
user mount them to the container in the first place.

Check the mount config to verify the executable lives in the mount's host path,
but then return an absolute path within the mount's task path so that we can hand
that off to libcontainer to run.

Includes a good bit of refactoring here because the anchoring of the final task
path has different code paths for inside the task dir vs inside a mount. But
I've fleshed out the test coverage of this a good bit to ensure we haven't
created any regressions in the process.
2022-11-11 09:51:15 -05:00
..
capabilities build: run gofmt on all go source files 2022-08-16 11:14:11 -05:00
eventer ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
executor exec: allow running commands from host volume (#14851) 2022-11-11 09:51:15 -05:00
hostnames test: use `T.TempDir` to create temporary test directory (#12853) 2022-05-12 11:42:40 -04:00
resolvconf test: use `T.TempDir` to create temporary test directory (#12853) 2022-05-12 11:42:40 -04:00