File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,20 @@ func (r *GrafanaServiceAccountReconciler) removeAccount(
290
290
)
291
291
return nil
292
292
}
293
- return fmt .Errorf ("deleting service account %q: %w" , status .SpecID , err )
293
+
294
+ // TODO: Grafana Operator currently deployes Grafana 11.3.0 (see controllers/config/operator_constants.go#L6).
295
+ // Till Grafana 12.0.2 there was no reliable way to detect a 404 when deleting a service account.
296
+ // The API still returns 500 (see grafana/grafana#106618).
297
+ //
298
+ // Once we upgrade to Grafana > 12.0.2 and bump github.com/grafana/grafana-openapi-client-go,
299
+ // we can handle the real 404 explicitly.
300
+ //
301
+ // In the meantime we treat any non-nil error from the delete call as "already removed" and just log it for visibility.
302
+ logf .FromContext (ctx ).Error (err , "failed to delete service account" ,
303
+ "serviceAccountID" , status .ServiceAccountID ,
304
+ "specID" , status .SpecID ,
305
+ )
306
+ // return fmt.Errorf("deleting service account %q: %w", status.SpecID, err)
294
307
}
295
308
296
309
return nil
You can’t perform that action at this time.
0 commit comments