@@ -20,6 +20,7 @@ import (
20
20
"context"
21
21
"encoding/json"
22
22
"fmt"
23
+ "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
23
24
blob_storage "github.com/devtron-labs/common-lib/blob-storage"
24
25
commonBean "github.com/devtron-labs/common-lib/workflow"
25
26
bean2 "github.com/devtron-labs/devtron/api/bean"
@@ -135,11 +136,11 @@ func (impl *TriggerServiceImpl) TriggerPreStage(request bean.TriggerRequest) (*b
135
136
runner .Status = cdWorkflow .WorkflowFailed
136
137
runner .Message = err .Error ()
137
138
runner .FinishedOn = time .Now ()
138
- _ = impl .cdWorkflowRepository . UpdateWorkFlowRunner (runner )
139
+ _ = impl .cdWorkflowRunnerService . UpdateCdWorkflowRunnerWithStage (runner )
139
140
return nil , err
140
141
} else {
141
142
runner .ImagePathReservationIds = imagePathReservationIds
142
- _ = impl .cdWorkflowRepository . UpdateWorkFlowRunner (runner )
143
+ _ = impl .cdWorkflowRunnerService . UpdateCdWorkflowRunnerWithStage (runner )
143
144
}
144
145
145
146
_ , span = otel .Tracer ("orchestrator" ).Start (ctx , "cdWorkflowService.SubmitWorkflow" )
@@ -152,7 +153,7 @@ func (impl *TriggerServiceImpl) TriggerPreStage(request bean.TriggerRequest) (*b
152
153
runner .Status = cdWorkflow .WorkflowFailed
153
154
runner .Message = err .Error ()
154
155
runner .FinishedOn = time .Now ()
155
- _ = impl .cdWorkflowRepository . UpdateWorkFlowRunner (runner )
156
+ _ = impl .cdWorkflowRunnerService . UpdateCdWorkflowRunnerWithStage (runner )
156
157
return nil , err
157
158
}
158
159
manifestPushTemplate , err := impl .getManifestPushTemplateForPreStage (ctx , envDeploymentConfig , pipeline , artifact , jobHelmPackagePath , cdWf , runner , triggeredBy , triggeredAt , request )
@@ -251,6 +252,7 @@ func (impl *TriggerServiceImpl) createStartingWfAndRunner(request bean.TriggerRe
251
252
WorkflowType : request .WorkflowType ,
252
253
ExecutorType : impl .config .GetWorkflowExecutorType (),
253
254
Status : cdWorkflow .WorkflowStarting , // starting PreStage
255
+ PodStatus : string (v1alpha1 .NodePending ),
254
256
TriggeredBy : triggeredBy ,
255
257
StartedOn : triggeredAt ,
256
258
Namespace : request .RunStageInEnvNamespace ,
@@ -262,7 +264,7 @@ func (impl *TriggerServiceImpl) createStartingWfAndRunner(request bean.TriggerRe
262
264
ReferenceId : request .TriggerContext .ReferenceId ,
263
265
}
264
266
_ , span := otel .Tracer ("orchestrator" ).Start (ctx , "cdWorkflowRepository.SaveWorkFlowRunner" )
265
- _ , err = impl .cdWorkflowRepository . SaveWorkFlowRunner (runner )
267
+ _ , err = impl .cdWorkflowRunnerService . SaveCDWorkflowRunnerWithStage (runner )
266
268
span .End ()
267
269
if err != nil {
268
270
return nil , nil , err
@@ -311,7 +313,7 @@ func (impl *TriggerServiceImpl) checkVulnerabilityStatusAndFailWfIfNeeded(ctx co
311
313
runner .FinishedOn = time .Now ()
312
314
runner .UpdatedOn = time .Now ()
313
315
runner .UpdatedBy = triggeredBy
314
- err = impl .cdWorkflowRepository . UpdateWorkFlowRunner (runner )
316
+ err = impl .cdWorkflowRunnerService . UpdateCdWorkflowRunnerWithStage (runner )
315
317
if err != nil {
316
318
impl .logger .Errorw ("error in updating wfr status due to vulnerable image" , "err" , err )
317
319
return err
0 commit comments