client: remove shortcircuit preventing poststart hooks from running
This commit is contained in:
parent
04a135b57d
commit
e1946b66ce
|
@ -63,8 +63,10 @@ func (c *taskHookCoordinator) setTasks(tasks []*structs.Task) {
|
|||
} else {
|
||||
c.prestartEphemeral[task.Name] = struct{}{}
|
||||
}
|
||||
case structs.TaskLifecycleHookPoststart:
|
||||
// Poststart hooks don't need to be tracked.
|
||||
default:
|
||||
c.logger.Error("invalid lifecycle hook", "hook", task.Lifecycle.Hook)
|
||||
c.logger.Error("invalid lifecycle hook", "task", task.Name, "hook", task.Lifecycle.Hook)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,11 +101,6 @@ func (c *taskHookCoordinator) startConditionForTask(task *structs.Task) <-chan s
|
|||
|
||||
// This is not thread safe! This must only be called from one thread per alloc runner.
|
||||
func (c *taskHookCoordinator) taskStateUpdated(states map[string]*structs.TaskState) {
|
||||
if c.mainTaskCtx.Err() != nil {
|
||||
// nothing to do here
|
||||
return
|
||||
}
|
||||
|
||||
for task := range c.prestartSidecar {
|
||||
st := states[task]
|
||||
if st == nil || st.StartedAt.IsZero() {
|
||||
|
|
Loading…
Reference in New Issue