Skip to content

Commit

Permalink
get rest config for external namespace only (#4269)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish-devtron committed Nov 22, 2023
1 parent 0ceac41 commit 47ed4fd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/pipeline/CiHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1640,23 +1640,24 @@ func (impl *CiHandlerImpl) UpdateCiWorkflowStatusFailure(timeoutForFailureCiBuil
for _, ciWorkflow := range ciWorkflows {
var isExt bool
var env *repository3.Environment
var restConfig *rest.Config
if ciWorkflow.Namespace != DefaultCiWorkflowNamespace {
isExt = true
env, err = impl.envRepository.FindById(ciWorkflow.EnvironmentId)
if err != nil {
impl.Logger.Errorw("could not fetch stage env", "err", err)
return err
}
restConfig, err = impl.getRestConfig(ciWorkflow)
if err != nil {
return err
}
}

isEligibleToMarkFailed := false
isPodDeleted := false
if time.Since(ciWorkflow.StartedOn) > (time.Minute * time.Duration(timeoutForFailureCiBuild)) {

restConfig, err := impl.getRestConfig(ciWorkflow)
if err != nil {
return err
}
//check weather pod is exists or not, if exits check its status
wf, err := impl.workflowService.GetWorkflowStatus(ciWorkflow.ExecutorType, ciWorkflow.Name, ciWorkflow.Namespace, restConfig)
if err != nil {
Expand Down

0 comments on commit 47ed4fd

Please sign in to comment.