Skip to content

Commit

Permalink
support Tekton PipelineRunStopping status
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomcli committed Apr 15, 2021
1 parent 7dd6e00 commit 02a97e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/apiserver/storage/run_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lib/StatusUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export enum NodePhase {
CONDITIONCHECKFAILED = 'ConditionCheckFailed',
PIPELINERUNCANCELLED = 'PipelineRunCancelled',
PIPELINERUNCOULDNTCANCEL = 'PipelineRunCouldntCancel',
PIPELINERUNSTOPPING = 'PipelineRunStopping',
TASKRUNCANCELLED = 'TaskRunCancelled',
TASKRUNCOULDNTCANCEL = 'TaskRunCouldntCancel',
TERMINATED = 'Terminated',
Expand Down Expand Up @@ -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' ||
Expand Down

0 comments on commit 02a97e6

Please sign in to comment.