Skip to content

Commit 2a3a987

Browse files
committed
merge fix
1 parent 1d68416 commit 2a3a987

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

pkg/pipeline/workflowStatus/WorkflowStageStatusService.go

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -283,25 +283,26 @@ func (impl *WorkFlowStageStatusServiceImpl) updateWorkflowStagesToDevtronStatus(
283283
updatedWfStatus = bean2.WORKFLOW_STAGE_STATUS_UNKNOWN.ToString()
284284
}
285285
}
286-
}
287-
if stage.StageName == bean2.WORKFLOW_PREPARATION && !stage.Status.IsTerminal() {
288-
//assumption: once pod is running we don't internally do any extra operation which would call this function and simply update status accrording to kubewatch events
289-
//that's why we are getting pod status as unknown because we don't explicity set pod status
290-
//this is the case when our internal code has called to update status before actually scheduling pod
291-
//update wf status as given in request, don't change that
292-
updatedWfStatus = util.ComputeWorkflowStatus(currentWfDBstatus, wfStatus, "")
293-
extractedStatus := adapter.ConvertStatusToDevtronStatus(wfStatus, wfMessage)
294-
if extractedStatus.IsTerminal() {
295-
stage.Status = extractedStatus
296-
stage.EndTime = time.Now().Format(bean3.LayoutRFC3339)
297-
if extractedStatus == bean2.WORKFLOW_STAGE_STATUS_TIMEOUT {
298-
updatedWfStatus = cdWorkflow.WorkflowTimedOut
299-
}
300-
if extractedStatus == bean2.WORKFLOW_STAGE_STATUS_ABORTED {
301-
updatedWfStatus = cdWorkflow.WorkflowCancel
286+
if stage.StageName == bean2.WORKFLOW_PREPARATION && !stage.Status.IsTerminal() {
287+
//assumption: once pod is running we don't internally do any extra operation which would call this function and simply update status accrording to kubewatch events
288+
//that's why we are getting pod status as unknown because we don't explicity set pod status
289+
//this is the case when our internal code has called to update status before actually scheduling pod
290+
//update wf status as given in request, don't change that
291+
updatedWfStatus = util.ComputeWorkflowStatus(currentWfDBstatus, wfStatus, "")
292+
extractedStatus := adapter.ConvertStatusToDevtronStatus(wfStatus, wfMessage)
293+
if extractedStatus.IsTerminal() {
294+
stage.Status = extractedStatus
295+
stage.EndTime = time.Now().Format(bean3.LayoutRFC3339)
296+
if extractedStatus == bean2.WORKFLOW_STAGE_STATUS_TIMEOUT {
297+
updatedWfStatus = cdWorkflow.WorkflowTimedOut
298+
}
299+
if extractedStatus == bean2.WORKFLOW_STAGE_STATUS_ABORTED {
300+
updatedWfStatus = cdWorkflow.WorkflowCancel
301+
}
302302
}
303303
}
304304
}
305+
305306
}
306307
}
307308

wire_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)