open-nomad/client/allocrunner/taskrunner
Danielle Lancashire 13d76e35fd
trhooks: Add TaskStopHook interface to services
We currently only run cleanup Service Hooks when a task is either
Killed, or Exited. However, due to the implementation of a task runner,
tasks are only Exited if they every correctly started running, which is
not true when you recieve an error early in the task start flow, such as
not being able to pull secrets from Vault.

This updates the service hook to also call consul deregistration
routines during a task Stop lifecycle event, to ensure that any
registered checks and services are cleared in such cases.

fixes #5770
2019-06-12 16:00:21 +02:00
..
getter
interfaces
restarts
state
template
testdata
artifact_hook.go
artifact_hook_test.go
device_hook.go
device_hook_test.go
dispatch_hook.go
dispatch_hook_test.go
driver_handle.go
errors.go
errors_test.go
lazy_handle.go
lifecycle.go
logmon_hook.go
logmon_hook_test.go
logmon_hook_unix_test.go
service_hook.go trhooks: Add TaskStopHook interface to services 2019-06-12 16:00:21 +02:00
service_hook_test.go
stats_hook.go
stats_hook_test.go
task_dir_hook.go
task_runner.go
task_runner_getters.go
task_runner_hooks.go
task_runner_test.go trhooks: Add TaskStopHook interface to services 2019-06-12 16:00:21 +02:00
template_hook.go
validate_hook.go
validate_hook_test.go
vault_hook.go
vault_hook_test.go