Merge pull request #222 from sgotti/executor_fix_reporting_of_stopped_tasks_and_steps
executor: fix reporting of stopped tasks and steps
This commit is contained in:
commit
a4e280cd7d
|
@ -776,7 +776,11 @@ func (e *Executor) executeTask(ctx context.Context, rt *runningTask) {
|
|||
rt.Lock()
|
||||
if err != nil {
|
||||
log.Errorf("err: %+v", err)
|
||||
et.Status.Phase = types.ExecutorTaskPhaseFailed
|
||||
if rt.et.Spec.Stop {
|
||||
et.Status.Phase = types.ExecutorTaskPhaseStopped
|
||||
} else {
|
||||
et.Status.Phase = types.ExecutorTaskPhaseFailed
|
||||
}
|
||||
} else {
|
||||
et.Status.Phase = types.ExecutorTaskPhaseSuccess
|
||||
}
|
||||
|
@ -951,7 +955,11 @@ func (e *Executor) executeTaskSteps(ctx context.Context, rt *runningTask, pod dr
|
|||
}
|
||||
serr = errors.Errorf("failed to execute step %s: %w", util.Dump(step), err)
|
||||
} else if exitCode != 0 {
|
||||
rt.et.Status.Steps[i].Phase = types.ExecutorTaskPhaseFailed
|
||||
if rt.et.Spec.Stop {
|
||||
rt.et.Status.Steps[i].Phase = types.ExecutorTaskPhaseStopped
|
||||
} else {
|
||||
rt.et.Status.Steps[i].Phase = types.ExecutorTaskPhaseFailed
|
||||
}
|
||||
rt.et.Status.Steps[i].ExitStatus = util.IntP(exitCode)
|
||||
serr = errors.Errorf("step %q failed with exitcode %d", stepName, exitCode)
|
||||
} else if exitCode == 0 {
|
||||
|
|
Loading…
Reference in New Issue