• Danielle Lancashire's avatar
    trhooks: Add TaskStopHook interface to services · 59335284
    Danielle Lancashire authored
    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
    59335284