executor: run exec commands in netns if set

This commit is contained in:
Nick Ethier
2019-09-30 11:50:22 -04:00
parent c36fe98198
commit 2f16eb9640
5 changed files with 32 additions and 28 deletions

View File

@@ -4,6 +4,7 @@ package executor
import (
hclog "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/plugins/drivers"
)
func NewExecutorWithIsolation(logger hclog.Logger) Executor {
@@ -23,3 +24,7 @@ func (e *UniversalExecutor) getAllPids() (map[int]*nomadPid, error) {
func (e *UniversalExecutor) start(command *ExecCommand) error {
return e.childCmd.Start()
}
func wrapNetns(f func() error, _ *drivers.NetworkIsolationSpec) error {
return f()
}