Skip to content

Commit

Permalink
Merge pull request #1619 from jenkins-x/retry_create_pr
Browse files Browse the repository at this point in the history
fix: retry creation of pipelinerun
  • Loading branch information
jenkins-x-bot authored Jan 6, 2025
2 parents d02948f + 63e4d3a commit 29e2152
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/engines/tekton/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ func (r *LighthouseJobReconciler) Reconcile(ctx context.Context, req ctrl.Reques

// if pipeline run does not exist, create it
if len(pipelineRunList.Items) == 0 {
if job.Status.State == lighthousev1alpha1.TriggeredState {
if job.Status.State == lighthousev1alpha1.TriggeredState ||
job.Status.State == lighthousev1alpha1.PendingState {
// construct a pipeline run
pipelineRun, err := makePipelineRun(ctx, job, r.namespace, r.logger, r.idGenerator, r.apiReader)
if err != nil {
Expand All @@ -129,7 +130,6 @@ func (r *LighthouseJobReconciler) Reconcile(ctx context.Context, req ctrl.Reques
}
}

// TODO: changing the status should be a consequence of a pipeline run being created
// update status
status := lighthousev1alpha1.LighthouseJobStatus{
State: lighthousev1alpha1.PendingState,
Expand All @@ -155,7 +155,7 @@ func (r *LighthouseJobReconciler) Reconcile(ctx context.Context, req ctrl.Reques
}
}
} else if len(pipelineRunList.Items) == 1 {
// if pipeline run exists, create it and update status
// if pipeline run exists, create pipelineactivity and update lighthousejob status
pipelineRun := pipelineRunList.Items[0]
if !r.disableLogging {
r.logger.Infof("Reconcile PipelineRun %+v", pipelineRun)
Expand Down

0 comments on commit 29e2152

Please sign in to comment.