Skip to content

Commit

Permalink
fix: Backoff issues for stacks and services (#1716)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm authored Dec 31, 2024
1 parent 4577faa commit 1b35874
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ func (r *InfrastructureStackReconciler) handleRepositoryRef(ctx context.Context,

if repository.Status.Health == v1alpha1.GitHealthFailed {
logger.Info("Repository is not healthy")
utils.MarkCondition(stack.SetCondition, v1alpha1.SynchronizedConditionType, v1.ConditionFalse, v1alpha1.SynchronizedConditionReason, "repository is not healthy")
return "", lo.ToPtr(RequeueAfter(requeueWaitForResources)), nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_
if service.Spec.RepositoryRef != nil {
if err := r.Get(ctx, client.ObjectKey{Name: service.Spec.RepositoryRef.Name, Namespace: service.Spec.RepositoryRef.Namespace}, repository); err != nil {
utils.MarkCondition(service.SetCondition, v1alpha1.SynchronizedConditionType, v1.ConditionFalse, v1alpha1.SynchronizedConditionReasonError, err.Error())
return ctrl.Result{}, err
return RequeueAfter(requeueWaitForResources), err
}
if !repository.DeletionTimestamp.IsZero() {
logger.Info("deleting service after repository deletion")
Expand All @@ -121,6 +121,7 @@ func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_
}
if repository.Status.Health == v1alpha1.GitHealthFailed {
logger.Info("Repository is not healthy")
utils.MarkCondition(service.SetCondition, v1alpha1.SynchronizedConditionType, v1.ConditionFalse, v1alpha1.SynchronizedConditionReason, "repository is not healthy")
return RequeueAfter(requeueWaitForResources), nil
}
}
Expand Down

0 comments on commit 1b35874

Please sign in to comment.