diff --git a/pkg/lifecycle/service.go b/pkg/lifecycle/service.go index 708ddb652..c26a3a88a 100644 --- a/pkg/lifecycle/service.go +++ b/pkg/lifecycle/service.go @@ -802,12 +802,14 @@ func (s *Service) runPipeline(ctx context.Context, rp *runnablePipeline) error { if updateErr := s.pipelines.UpdateStatus(ctx, rp.pipeline.ID, pipeline.StatusDegraded, fmt.Sprintf("%+v", recoveryErr)); updateErr != nil { return updateErr } + + // we assign it to err so it's returned and notified by the cleanup function + err = recoveryErr + } else { + // recovery was triggered didn't error, so no cleanup + // this is why we return nil to skip the cleanup below. + return nil } - // recovery was triggered, so no cleanup - // (remove running pipeline, notify failure handlers, etc.) - // is needed - // this is why we return nil to skip the cleanup below. - return nil } }