mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 00:15:43 +03:00
Fix #9210 . This update the executor so it honors the User when using nomad alloc exec. The bug was that the exec task didn't honor the init command when execing.
33 lines
794 B
Go
33 lines
794 B
Go
// +build !linux
|
|
|
|
package executor
|
|
|
|
import (
|
|
"os/exec"
|
|
|
|
hclog "github.com/hashicorp/go-hclog"
|
|
"github.com/hashicorp/nomad/plugins/drivers"
|
|
)
|
|
|
|
func NewExecutorWithIsolation(logger hclog.Logger) Executor {
|
|
logger = logger.Named("executor")
|
|
logger.Error("isolation executor is not supported on this platform, using default")
|
|
return NewExecutor(logger)
|
|
}
|
|
|
|
func (e *UniversalExecutor) configureResourceContainer(_ int) error { return nil }
|
|
|
|
func (e *UniversalExecutor) getAllPids() (map[int]*nomadPid, error) {
|
|
return getAllPidsByScanning()
|
|
}
|
|
|
|
func (e *UniversalExecutor) start(command *ExecCommand) error {
|
|
return e.childCmd.Start()
|
|
}
|
|
|
|
func withNetworkIsolation(f func() error, _ *drivers.NetworkIsolationSpec) error {
|
|
return f()
|
|
}
|
|
|
|
func setCmdUser(*exec.Cmd, string) error { return nil }
|