executor: fix stopping of not running tasks

When a related runningTask doesn't exist and the executor task status is
running just report it as failed ignoring if it's marked to stop.
This commit is contained in:
Simone Gotti 2020-02-28 10:42:46 +01:00
parent a4e280cd7d
commit 97d145a9d3
1 changed files with 1 additions and 1 deletions

View File

@ -1168,7 +1168,7 @@ func (e *Executor) taskUpdater(ctx context.Context, et *types.ExecutorTask) {
}()
}
if !et.Spec.Stop && et.Status.Phase == types.ExecutorTaskPhaseRunning {
if et.Status.Phase == types.ExecutorTaskPhaseRunning {
log.Infof("marking executor task %s as failed since there's no running task", et.ID)
et.Status.Phase = types.ExecutorTaskPhaseFailed
et.Status.EndTime = util.TimeP(time.Now())