mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
honor task user when execing into raw_exec task (#9439)
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.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
package executor
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
|
||||
hclog "github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/nomad/plugins/drivers"
|
||||
)
|
||||
@@ -15,8 +17,6 @@ func NewExecutorWithIsolation(logger hclog.Logger) Executor {
|
||||
|
||||
func (e *UniversalExecutor) configureResourceContainer(_ int) error { return nil }
|
||||
|
||||
func (e *UniversalExecutor) runAs(_ string) error { return nil }
|
||||
|
||||
func (e *UniversalExecutor) getAllPids() (map[int]*nomadPid, error) {
|
||||
return getAllPidsByScanning()
|
||||
}
|
||||
@@ -28,3 +28,5 @@ func (e *UniversalExecutor) start(command *ExecCommand) error {
|
||||
func withNetworkIsolation(f func() error, _ *drivers.NetworkIsolationSpec) error {
|
||||
return f()
|
||||
}
|
||||
|
||||
func setCmdUser(*exec.Cmd, string) error { return nil }
|
||||
|
||||
Reference in New Issue
Block a user