Skip to content

Commit

Permalink
fix(KFLUXBUGS-1485): cancelled state on stopped runs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroPP committed Nov 19, 2024
1 parent 2d6db11 commit a5528e2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/utils/pipeline-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export const conditionsRunStatus = (conditions: Condition[], specStatus?: string
}

const cancelledCondition = conditions.find((c) => c.reason === 'Cancelled');
const stoppingCondition = conditions.find((c) => c.reason === 'StoppedRunningFinally');
const succeedCondition = conditions.find((c) => c.type === 'Succeeded');

if (!succeedCondition || !succeedCondition.status) {
Expand All @@ -197,11 +198,8 @@ export const conditionsRunStatus = (conditions: Condition[], specStatus?: string
: runStatus.Running;

if (
[
`${SucceedConditionReason.PipelineRunStopped}`,
`${SucceedConditionReason.PipelineRunCancelled}`,
].includes(specStatus) &&
!cancelledCondition
(specStatus === SucceedConditionReason.PipelineRunCancelled && !cancelledCondition) ||
(specStatus === SucceedConditionReason.PipelineRunStopped && stoppingCondition)
) {
return runStatus.Cancelling;
}
Expand Down

0 comments on commit a5528e2

Please sign in to comment.