Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't requeue if dashboard CR are broken #1236

Merged
merged 3 commits into from
Sep 26, 2023

Conversation

NissesSenap
Copy link
Collaborator

fixes #1091

@NissesSenap
Copy link
Collaborator Author

@weisdd is it worth doing some kind of status update, or should we just skip the reconcile?

@@ -194,13 +194,13 @@ func (r *GrafanaDashboardReconciler) Reconcile(ctx context.Context, req ctrl.Req
dashboardJson, err := r.fetchDashboardJson(ctx, cr)
if err != nil {
controllerLog.Error(err, "error fetching dashboard", "dashboard", cr.Name)
return ctrl.Result{RequeueAfter: RequeueDelay}, nil
return ctrl.Result{Requeue: false}, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can fail due to multiple reasons including temporary connectivity loss. So, I would say we can judge whether it's worth re-queueing only if we make fetchDashboardJson return easily distinguishable errors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right, I will create a custom error and update the PR. Hopefully sometime next week.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave this some more thought.
In many of these cases we actually want a retry a and in the case of dashboard.Spec.Json we don't even return an error since it's more or less not possible to generate one.

So I didn't really see the need to do a bunch of custom errors for this use case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the updated implementation should help with the broken JSON, and, indeed, custom errors are not needed in this case.

@NissesSenap NissesSenap merged commit 8397eba into grafana:master Sep 26, 2023
9 checks passed
@NissesSenap NissesSenap deleted the broken_json_spec branch September 26, 2023 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants