From d1f91a639b0ce1d5c39bc081238184cc83622e36 Mon Sep 17 00:00:00 2001 From: tomcli Date: Thu, 15 Apr 2021 13:02:10 -0700 Subject: [PATCH] support Tekton PipelineRunStopping status --- backend/src/apiserver/storage/run_store.go | 4 ++-- frontend/src/lib/StatusUtils.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/storage/run_store.go b/backend/src/apiserver/storage/run_store.go index 5d2b37118e..e91d428d49 100644 --- a/backend/src/apiserver/storage/run_store.go +++ b/backend/src/apiserver/storage/run_store.go @@ -605,8 +605,8 @@ func (s *RunStore) TerminateRun(runId string) error { result, err := s.db.Exec(` UPDATE run_details SET Conditions = ? - WHERE UUID = ? AND (Conditions = ? OR Conditions = ? OR Conditions = ?)`, - model.RunTerminatingConditions, runId, string("Running"), string("Pending"), "") + WHERE UUID = ? AND (Conditions = ? OR Conditions = ? OR Conditions = ? OR Conditions = ?)`, + model.RunTerminatingConditions, runId, string("Running"), string("Pending"), "", string("PipelineRunStopping")) if err != nil { return util.NewInternalServerError(err, diff --git a/frontend/src/lib/StatusUtils.ts b/frontend/src/lib/StatusUtils.ts index e8575f00ee..cf2915081a 100644 --- a/frontend/src/lib/StatusUtils.ts +++ b/frontend/src/lib/StatusUtils.ts @@ -42,6 +42,7 @@ export enum NodePhase { CONDITIONCHECKFAILED = 'ConditionCheckFailed', PIPELINERUNCANCELLED = 'PipelineRunCancelled', PIPELINERUNCOULDNTCANCEL = 'PipelineRunCouldntCancel', + PIPELINERUNSTOPPING = 'PipelineRunStopping', TASKRUNCANCELLED = 'TaskRunCancelled', TASKRUNCOULDNTCANCEL = 'TaskRunCouldntCancel', TERMINATED = 'Terminated', @@ -131,6 +132,7 @@ export function statusToPhase(nodeStatus: string | undefined): NodePhase { else if (nodeStatus === 'Completed') return 'Succeeded' as NodePhase; else if (nodeStatus === 'ConditionCheckFailed') return 'Skipped' as NodePhase; else if (nodeStatus === 'CouldntGetCondition') return 'Error' as NodePhase; + else if (nodeStatus === 'PipelineRunStopping') return 'Running' as NodePhase; else if ( nodeStatus === 'PipelineRunCancelled' || nodeStatus === 'PipelineRunCouldntCancel' ||