mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
populate Nomad token for task runner update hooks (#16266)
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).
This commit is contained in:
3
.changelog/16266.txt
Normal file
3
.changelog/16266.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
template: Fixed a bug where the template runner's Nomad token would be erased by in-place updates to a task
|
||||||
|
```
|
||||||
@@ -487,6 +487,7 @@ func (tr *TaskRunner) updateHooks() {
|
|||||||
|
|
||||||
// Build the request
|
// Build the request
|
||||||
req := interfaces.TaskUpdateRequest{
|
req := interfaces.TaskUpdateRequest{
|
||||||
|
NomadToken: tr.getNomadToken(),
|
||||||
VaultToken: tr.getVaultToken(),
|
VaultToken: tr.getVaultToken(),
|
||||||
Alloc: alloc,
|
Alloc: alloc,
|
||||||
TaskEnv: tr.envBuilder.Build(),
|
TaskEnv: tr.envBuilder.Build(),
|
||||||
|
|||||||
Reference in New Issue
Block a user