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 and tgross committed May 17, 2021
1 parent 9f86b0e commit 553e066
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 @@ -138,14 +138,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 553e066

Please sign in to comment.