-
Notifications
You must be signed in to change notification settings - Fork 388
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
Conversation
@weisdd is it worth doing some kind of status update, or should we just skip the reconcile? |
controllers/dashboard_controller.go
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
c187e35
to
ad7529f
Compare
fixes #1091