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.
This commit is contained in:
Danielle Tomlinson
2019-01-03 13:13:57 +01:00
parent c64b41d154
commit 54dde24bcb

View File

@@ -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