alloc_runner: stop sidecar tasks last (#13055)

alloc_runner: stop sidecar tasks last
This commit is contained in:
Derek Strickland
2022-06-07 11:35:19 -04:00
committed by GitHub
parent 78553f9aad
commit ec3b7150e4
5 changed files with 175 additions and 16 deletions

View File

@@ -33,6 +33,11 @@ func (tr *TaskRunner) IsPoststopTask() bool {
return tr.Task().Lifecycle != nil && tr.Task().Lifecycle.Hook == structs.TaskLifecycleHookPoststop
}
// IsSidecarTask returns true if this task is a sidecar task in its task group.
func (tr *TaskRunner) IsSidecarTask() bool {
return tr.Task().Lifecycle != nil && tr.Task().Lifecycle.Sidecar
}
func (tr *TaskRunner) Task() *structs.Task {
tr.taskLock.RLock()
defer tr.taskLock.RUnlock()