From 0f1147e55e1a68b84d299ef90d0053ce71e84484 Mon Sep 17 00:00:00 2001 From: Tommy Li Date: Fri, 16 Apr 2021 08:30:14 -0700 Subject: [PATCH] Support Tekton PipelineRunStopping status (#545) --- 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 5d2b37118e9..e91d428d49e 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 56d00364ef5..fb0b9f5bd75 100644 --- a/frontend/src/lib/StatusUtils.ts +++ b/frontend/src/lib/StatusUtils.ts @@ -43,6 +43,7 @@ export enum NodePhase { CONDITIONCHECKFAILED = 'ConditionCheckFailed', PIPELINERUNCANCELLED = 'PipelineRunCancelled', PIPELINERUNCOULDNTCANCEL = 'PipelineRunCouldntCancel', + PIPELINERUNSTOPPING = 'PipelineRunStopping', TASKRUNCANCELLED = 'TaskRunCancelled', TASKRUNCOULDNTCANCEL = 'TaskRunCouldntCancel', TERMINATED = 'Terminated', @@ -136,6 +137,7 @@ export function statusToPhase(nodeStatus: string | undefined): NodePhase { 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' ||