|
|
|
@ -155,7 +155,7 @@ func (dr *DashboardServiceImpl) Count(ctx context.Context, scopeParams *quota.Sc |
|
|
|
|
|
|
|
|
|
total := int64(0) |
|
|
|
|
for _, org := range orgs { |
|
|
|
|
ctx, _ := identity.WithServiceIdentitiy(ctx, org.ID) |
|
|
|
|
ctx, _ := identity.WithServiceIdentity(ctx, org.ID) |
|
|
|
|
orgDashboards, err := dr.CountDashboardsInOrg(ctx, org.ID) |
|
|
|
|
if err != nil { |
|
|
|
|
return nil, err |
|
|
|
@ -557,7 +557,7 @@ func (dr *DashboardServiceImpl) DeleteOrphanedProvisionedDashboards(ctx context. |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for _, org := range orgs { |
|
|
|
|
ctx, _ := identity.WithServiceIdentitiy(ctx, org.ID) |
|
|
|
|
ctx, _ := identity.WithServiceIdentity(ctx, org.ID) |
|
|
|
|
// find all dashboards in the org that have a file repo set that is not in the given readers list
|
|
|
|
|
foundDashs, err := dr.searchProvisionedDashboardsThroughK8s(ctx, dashboards.FindPersistedDashboardsQuery{ |
|
|
|
|
ProvisionedReposNotIn: cmd.ReaderNames, |
|
|
|
@ -658,7 +658,7 @@ func (dr *DashboardServiceImpl) SaveProvisionedDashboard(ctx context.Context, dt |
|
|
|
|
dto.Dashboard.Data.Set("refresh", dr.cfg.MinRefreshInterval) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ctx, ident := identity.WithServiceIdentitiy(ctx, dto.OrgID) |
|
|
|
|
ctx, ident := identity.WithServiceIdentity(ctx, dto.OrgID) |
|
|
|
|
dto.User = ident |
|
|
|
|
|
|
|
|
|
cmd, err := dr.BuildSaveDashboardCommand(ctx, dto, false) |
|
|
|
@ -698,7 +698,7 @@ func (dr *DashboardServiceImpl) SaveFolderForProvisionedDashboards(ctx context.C |
|
|
|
|
ctx, span := tracer.Start(ctx, "dashboards.service.SaveFolderForProvisionedDashboards") |
|
|
|
|
defer span.End() |
|
|
|
|
|
|
|
|
|
ctx, ident := identity.WithServiceIdentitiy(ctx, dto.OrgID) |
|
|
|
|
ctx, ident := identity.WithServiceIdentity(ctx, dto.OrgID) |
|
|
|
|
dto.SignedInUser = ident |
|
|
|
|
|
|
|
|
|
f, err := dr.folderService.Create(ctx, dto) |
|
|
|
@ -843,7 +843,7 @@ func (dr *DashboardServiceImpl) GetDashboardByPublicUid(ctx context.Context, das |
|
|
|
|
|
|
|
|
|
// DeleteProvisionedDashboard removes dashboard from the DB even if it is provisioned.
|
|
|
|
|
func (dr *DashboardServiceImpl) DeleteProvisionedDashboard(ctx context.Context, dashboardId int64, orgId int64) error { |
|
|
|
|
ctx, _ = identity.WithServiceIdentitiy(ctx, orgId) |
|
|
|
|
ctx, _ = identity.WithServiceIdentity(ctx, orgId) |
|
|
|
|
return dr.deleteDashboard(ctx, dashboardId, "", orgId, false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -925,7 +925,7 @@ func (dr *DashboardServiceImpl) UnprovisionDashboard(ctx context.Context, dashbo |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for _, org := range orgs { |
|
|
|
|
ctx, _ = identity.WithServiceIdentitiy(ctx, org.ID) |
|
|
|
|
ctx, _ = identity.WithServiceIdentity(ctx, org.ID) |
|
|
|
|
dash, err := dr.getDashboardThroughK8s(ctx, &dashboards.GetDashboardQuery{OrgID: org.ID, ID: dashboardId}) |
|
|
|
|
if err != nil { |
|
|
|
|
// if we can't find it in this org, try the next one
|
|
|
|
@ -1730,7 +1730,7 @@ type dashboardProvisioningWithUID struct { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (dr *DashboardServiceImpl) searchProvisionedDashboardsThroughK8s(ctx context.Context, query dashboards.FindPersistedDashboardsQuery) ([]*dashboardProvisioningWithUID, error) { |
|
|
|
|
ctx, _ = identity.WithServiceIdentitiy(ctx, query.OrgId) |
|
|
|
|
ctx, _ = identity.WithServiceIdentity(ctx, query.OrgId) |
|
|
|
|
|
|
|
|
|
if query.ProvisionedRepo != "" { |
|
|
|
|
query.ProvisionedRepo = provisionedFileNameWithPrefix(query.ProvisionedRepo) |
|
|
|
|