You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: controllers/serviceaccount_controller.go
+15-42Lines changed: 15 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -286,63 +286,36 @@ func buildUpdateFormIfNeeded(spec *v1beta1.GrafanaServiceAccountSpec, status *v1
286
286
returnform
287
287
}
288
288
289
-
// computeGrafanaLogin reconstructs the internal login identifier that Grafana generates for a service account.
290
-
//
291
-
// Grafana internally uses two fields: 'login' (immutable identifier) and 'name' (display name).
292
-
// When creating a service account via API, you only provide 'name', and Grafana generates 'login'
293
-
// using the pattern: "sa-{orgID}-{name}". Since we only store the desired name in the CR spec
294
-
// and need to find existing accounts, we need to recreate this logic to compute the expected login.
295
-
//
296
-
// NOTE: This is a workaround that duplicates Grafana's internal logic. Ideally, Grafana would
297
-
// support metadata/labels on service accounts or provide direct lookup by name. Until then,
298
-
// we rely on this reverse-engineered logic to match accounts.
299
-
//
300
-
// Borrowed from Grafana: https://github.com/grafana/grafana/blob/e3cb84bef8579db2cead8398b751c5d2c9d563f0/pkg/services/serviceaccounts/database/store.go#L61
0 commit comments