From 28aa34ea781c9f2153198fcd4608965fee9caabe Mon Sep 17 00:00:00 2001 From: Danielle Tomlinson Date: Thu, 3 Jan 2019 13:13:57 +0100 Subject: [PATCH] taskrunner: Persist environment from hooks https://github.com/hashicorp/nomad/pull/5032 introduced a regression where the origHookState was used in place of the response from the hook. --- client/allocrunner/taskrunner/task_runner_hooks.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/allocrunner/taskrunner/task_runner_hooks.go b/client/allocrunner/taskrunner/task_runner_hooks.go index 2e6fce183..6aa0da23a 100644 --- a/client/allocrunner/taskrunner/task_runner_hooks.go +++ b/client/allocrunner/taskrunner/task_runner_hooks.go @@ -218,9 +218,9 @@ func (tr *TaskRunner) prestart() error { // Store the environment variables returned by the hook if name == HookNameDevices { - tr.envBuilder.SetDeviceHookEnv(name, origHookState.Env) + tr.envBuilder.SetDeviceHookEnv(name, resp.Env) } else { - tr.envBuilder.SetHookEnv(name, origHookState.Env) + tr.envBuilder.SetHookEnv(name, resp.Env) } // Store the resources