Skip to content

Commit

Permalink
populate Nomad token for task runner update hooks
Browse files Browse the repository at this point in the history
The `TaskUpdateRequest` struct we send to task runner update hooks was not
populating the Nomad token that we get from the task runner (which we do for the
Vault token). This results in task runner hooks like the template hook
overwriting the Nomad token with the zero value for the token. This causes
in-place updates of a task to break templates (but not other uses that rely on
identity but don't currently bother to update it, like the identity hook).
  • Loading branch information
tgross committed Feb 27, 2023
1 parent 7c56fd5 commit 791204d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client/allocrunner/taskrunner/task_runner_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ func (tr *TaskRunner) updateHooks() {

// Build the request
req := interfaces.TaskUpdateRequest{
NomadToken: tr.getNomadToken(),
VaultToken: tr.getVaultToken(),
Alloc: alloc,
TaskEnv: tr.envBuilder.Build(),
Expand Down

0 comments on commit 791204d

Please sign in to comment.