executor: set task endTime when marking as failed

Add missing set of task endTime when the executor is marking the task as failed
due to no related running task (usually after executor restart).
This commit is contained in:
Simone Gotti 2019-07-29 09:58:17 +02:00
parent e2526a6399
commit 1707be9528

View File

@ -1162,6 +1162,7 @@ func (e *Executor) taskUpdater(ctx context.Context, et *types.ExecutorTask) {
if !ok {
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.TimePtr(time.Now())
// mark in progress step as failed too
for _, s := range et.Status.Steps {
if s.Phase == types.ExecutorTaskPhaseRunning {