Skip to content

Commit ceaca80

Browse files
committed
Clarify on 404 handling
1 parent 48e70ba commit ceaca80

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

controllers/serviceaccount_controller.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,15 @@ func (r *GrafanaServiceAccountReconciler) finalize(ctx context.Context, cr *v1be
224224
return nil
225225
}
226226

227-
// TODO: Grafana Operator currently deploys Grafana 11.3.0 (see controllers/config/operator_constants.go#L6).
228-
// Until Grafana 12.0.2 there was no reliable way to detect a 404 when deleting a service account.
229-
// The API still returns 500 (see https://github.com/grafana/grafana/issues/106618).
227+
// TODO: The operator now deploys Grafana 12.1.0 by default (see controllers/config/operator_constants.go#L6),
228+
// but it may still manage older Grafana instances.
230229
//
231-
// Once we upgrade to Grafana > 12.0.2 and bump github.com/grafana/grafana-openapi-client-go,
232-
// we can handle the real 404 explicitly.
230+
// Before Grafana 12.0.2, there was no reliable way to detect a 404 when deleting a service account.
231+
// The API returned 500 instead (see https://github.com/grafana/grafana/issues/106618).
233232
//
234-
// In the meantime we treat any non-nil error from the delete call as "already removed" and just log it for visibility.
233+
// Once we can guarantee all managed instances are >= 12.0.2 we can handle the real 404 explicitly.
234+
//
235+
// Until then, we treat any non-nil error from the delete call as "already removed" and just log it for visibility.
235236
logf.FromContext(ctx).Error(err, "failed to delete service account (may already be deleted)",
236237
"serviceAccountID", cr.Status.Account.ID,
237238
"serviceAccountName", cr.Spec.Name,

0 commit comments

Comments
 (0)