Skip to content

Commit 7e0aa0a

Browse files
fix 01
Signed-off-by: Sean Conroy <sconroy@redhat.com>
1 parent 6c427aa commit 7e0aa0a

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

api/v1alpha1/release_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ func (r *Release) MarkCurrentManagedPipelineAttemptProcessed() {
475475
}
476476

477477
attempt := r.GetCurrentManagedPipelineAttempt()
478+
if attempt == nil {
479+
return
480+
}
481+
478482
attempt.Status = AttemptSucceededReason
479483
attempt.CompletionTime = &metav1.Time{Time: time.Now()}
480484

@@ -728,6 +732,10 @@ func (r *Release) MarkCurrentManagedPipelineAttemptFailed(message, failureReason
728732
}
729733

730734
attempt := r.GetCurrentManagedPipelineAttempt()
735+
if attempt == nil {
736+
return
737+
}
738+
731739
attempt.Status = AttemptFailedReason
732740
attempt.CompletionTime = &metav1.Time{Time: time.Now()}
733741
attempt.FailureReason = failureReason

controllers/release/adapter.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,12 @@ func (a *adapter) EnsureManagedPipelineIsProcessed() (controller.OperationResult
548548
return controller.RequeueOnErrorOrContinue(a.client.Status().Patch(a.ctx, a.release, patch))
549549
}
550550

551-
pipelineRun, err := a.loader.GetReleasePipelineRun(a.ctx, a.client, a.release, metadata.ManagedPipelineType)
551+
// Let the completion operation handle retry when the current attempt has failed
552+
if a.release.IsCurrentManagedPipelineAttemptFailed() {
553+
return controller.ContinueProcessing()
554+
}
555+
556+
pipelineRun, err := a.loader.GetReleasePipelineRunAttempt(a.ctx, a.client, a.release, a.release.GetManagedPipelineRetryCount())
552557
if err != nil && !errors.IsNotFound(err) {
553558
return controller.RequeueWithError(err)
554559
}

0 commit comments

Comments
 (0)