K8s: Improve identity mapping setup (#89450)

This commit is contained in:
Ryan McKinley
2024-06-20 17:53:07 +03:00
committed by GitHub
parent fc4a9904c9
commit 27e800768e
30 changed files with 205 additions and 142 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import (
"sync"
"time"
"github.com/grafana/grafana/pkg/infra/appcontext"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
"github.com/grafana/grafana/pkg/tsdb/grafanads"
@@ -122,12 +122,12 @@ func (c *dsCache) getDS(ctx context.Context, uid string) (*dsVal, error) {
}
}
usr, err := appcontext.User(ctx)
usr, err := identity.GetRequester(ctx)
if err != nil {
return nil, nil // no user
}
v, ok := c.cache[usr.OrgID]
v, ok := c.cache[usr.GetOrgID()]
if !ok {
return nil, nil // org not found
}