Merge pull request #10403 from hashicorp/b-always-set-scriptchecks-hook

client: always set script checks hook
This commit is contained in:
Seth Hoenig
2021-04-19 16:13:45 -06:00
committed by GitHub

View File

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