Skip to content

Commit

Permalink
refactor: Align folder error logging with other CRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Baarsgaard committed Nov 26, 2024
1 parent d9b7a12 commit 9ec113d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions controllers/grafanafolder_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,14 @@ func (r *GrafanaFolderReconciler) Reconcile(ctx context.Context, req ctrl.Reques

err = r.onFolderCreated(ctx, &grafana, folder)
if err != nil {
controllerLog.Error(err, "error reconciling folder", "folder", folder.Name, "grafana", grafana.Name)
applyErrors[fmt.Sprintf("%s/%s", grafana.Namespace, grafana.Name)] = err.Error()
}
}
condition := buildSynchronizedCondition("Folder", conditionFolderSynchronized, folder.Generation, applyErrors, len(instances))
meta.SetStatusCondition(&folder.Status.Conditions, condition)

if len(applyErrors) != 0 {
return ctrl.Result{RequeueAfter: RequeueDelay}, nil
if len(applyErrors) > 0 {
return ctrl.Result{RequeueAfter: RequeueDelay}, fmt.Errorf("failed to apply to all instances: %v", applyErrors)
}

if folder.ResyncPeriodHasElapsed() {
Expand Down

0 comments on commit 9ec113d

Please sign in to comment.