Skip to content

Commit

Permalink
Merge pull request #10403 from hashicorp/b-always-set-scriptchecks-hook
Browse files Browse the repository at this point in the history
client: always set script checks hook
  • Loading branch information
shoenig authored Apr 19, 2021
2 parents fc8ffe9 + 94399ff commit 2fc19c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/allocrunner/taskrunner/task_runner_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ func (tr *TaskRunner) initHooks() {
}
}

// If there are any script checks, add the hook
scriptCheckHook := newScriptCheckHook(scriptCheckHookConfig{
// Always add the script checks hook. A task with no script check hook on
// initial registration may be updated to include script checks, which must
// be handled with this hook.
tr.runnerHooks = append(tr.runnerHooks, newScriptCheckHook(scriptCheckHookConfig{
alloc: tr.Alloc(),
task: tr.Task(),
consul: tr.consulServiceClient,
logger: hookLogger,
})
tr.runnerHooks = append(tr.runnerHooks, scriptCheckHook)
}))
}

func (tr *TaskRunner) emitHookError(err error, hookName string) {
Expand Down

0 comments on commit 2fc19c3

Please sign in to comment.