mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 19:05:42 +03:00
Set the allocdir correctly when using the linux executor
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/nomad/client/allocdir"
|
||||
"github.com/hashicorp/nomad/client/driver/environment"
|
||||
"github.com/hashicorp/nomad/command"
|
||||
"github.com/hashicorp/nomad/helper/discover"
|
||||
"github.com/hashicorp/nomad/nomad/structs"
|
||||
@@ -127,6 +128,11 @@ func (e *LinuxExecutor) ConfigureTaskDir(taskName string, alloc *allocdir.AllocD
|
||||
return fmt.Errorf("Couldn't mount /proc to %v: %v", proc, err)
|
||||
}
|
||||
|
||||
// Set the tasks AllocDir environment variable.
|
||||
env := environment.ParseFromList(e.Cmd.Env)
|
||||
env.SetAllocDir(filepath.Join(taskDir, allocdir.SharedAllocName))
|
||||
e.Cmd.Env = env.List()
|
||||
|
||||
e.alloc = alloc
|
||||
e.mounts = true
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user