Skip to content

Commit

Permalink
fix: requeue on apply errors
Browse files Browse the repository at this point in the history
reduces time to creation if folder & group are applied simultaneously
  • Loading branch information
theSuess committed Jul 30, 2024
1 parent 4801274 commit df14c74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/grafanaalertrulegroup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ func (r *GrafanaAlertRuleGroupReconciler) Reconcile(ctx context.Context, req ctr
}
condition := buildSynchronizedCondition("Alert Rule Group", conditionAlertGroupSynchronized, group.Generation, applyErrors, len(instances))
meta.SetStatusCondition(&group.Status.Conditions, condition)

if len(applyErrors) > 0 {
return ctrl.Result{}, fmt.Errorf("failed to apply to all instances: %v", applyErrors)
}
return ctrl.Result{RequeueAfter: group.Spec.ResyncPeriod.Duration}, nil
}

Expand Down

0 comments on commit df14c74

Please sign in to comment.