@@ -45,7 +45,7 @@ func (prov *defaultAlertRuleProvisioner) Provision(ctx context.Context,
|
||||
files []*AlertingFile) error {
|
||||
for _, file := range files {
|
||||
for _, group := range file.Groups {
|
||||
ctx, u := identity.WithServiceIdentitiy(ctx, group.OrgID)
|
||||
ctx, u := identity.WithServiceIdentity(ctx, group.OrgID)
|
||||
|
||||
folderUID, err := prov.getOrCreateFolderFullpath(ctx, group.FolderFullpath, group.OrgID)
|
||||
if err != nil {
|
||||
@@ -121,7 +121,7 @@ func (prov *defaultAlertRuleProvisioner) getOrCreateFolderFullpath(
|
||||
|
||||
func (prov *defaultAlertRuleProvisioner) getOrCreateFolderByTitle(
|
||||
ctx context.Context, folderName string, orgID int64, parentUID *string) (string, error) {
|
||||
ctx, user := identity.WithServiceIdentitiy(ctx, orgID)
|
||||
ctx, user := identity.WithServiceIdentity(ctx, orgID)
|
||||
|
||||
cmd := &folder.GetFolderQuery{
|
||||
Title: &folderName,
|
||||
|
||||
@@ -148,7 +148,7 @@ func (fr *FileReader) isDatabaseAccessRestricted() bool {
|
||||
// storeDashboardsInFolder saves dashboards from the filesystem on disk to the folder from config
|
||||
func (fr *FileReader) storeDashboardsInFolder(ctx context.Context, filesFoundOnDisk map[string]os.FileInfo,
|
||||
dashboardRefs map[string]*dashboards.DashboardProvisioning, usageTracker *usageTracker) error {
|
||||
ctx, _ = identity.WithServiceIdentitiy(ctx, fr.Cfg.OrgID)
|
||||
ctx, _ = identity.WithServiceIdentity(ctx, fr.Cfg.OrgID)
|
||||
|
||||
folderID, folderUID, err := fr.getOrCreateFolder(ctx, fr.Cfg, fr.dashboardProvisioningService, fr.Cfg.Folder)
|
||||
if err != nil && !errors.Is(err, ErrFolderNameMissing) {
|
||||
@@ -180,7 +180,7 @@ func (fr *FileReader) storeDashboardsInFoldersFromFileStructure(ctx context.Cont
|
||||
folderName = filepath.Base(dashboardsFolder)
|
||||
}
|
||||
|
||||
ctx, _ = identity.WithServiceIdentitiy(ctx, fr.Cfg.OrgID)
|
||||
ctx, _ = identity.WithServiceIdentity(ctx, fr.Cfg.OrgID)
|
||||
folderID, folderUID, err := fr.getOrCreateFolder(ctx, fr.Cfg, fr.dashboardProvisioningService, folderName)
|
||||
if err != nil && !errors.Is(err, ErrFolderNameMissing) {
|
||||
return fmt.Errorf("%w with name %q from file system structure: %w", ErrGetOrCreateFolder, folderName, err)
|
||||
|
||||
@@ -411,7 +411,7 @@ func TestDashboardFileReader(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, _ = identity.WithServiceIdentitiy(ctx, 1)
|
||||
ctx, _ = identity.WithServiceIdentity(ctx, 1)
|
||||
_, _, err = r.getOrCreateFolder(ctx, cfg, fakeService, cfg.Folder)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
@@ -433,7 +433,7 @@ func TestDashboardFileReader(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, _ = identity.WithServiceIdentitiy(ctx, 1)
|
||||
ctx, _ = identity.WithServiceIdentity(ctx, 1)
|
||||
_, _, err = r.getOrCreateFolder(ctx, cfg, fakeService, cfg.Folder)
|
||||
require.ErrorIs(t, err, dashboards.ErrFolderInvalidUID)
|
||||
})
|
||||
|
||||
@@ -56,7 +56,7 @@ func TestDuplicatesValidator(t *testing.T) {
|
||||
const folderName = "duplicates-validator-folder"
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, _ = identity.WithServiceIdentitiy(ctx, 1)
|
||||
ctx, _ = identity.WithServiceIdentity(ctx, 1)
|
||||
|
||||
fakeStore := &fakeDashboardStore{}
|
||||
r, err := NewDashboardFileReader(cfg, logger, nil, fakeStore, folderSvc)
|
||||
@@ -115,7 +115,7 @@ func TestDuplicatesValidator(t *testing.T) {
|
||||
const folderName = "duplicates-validator-folder"
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, _ = identity.WithServiceIdentitiy(ctx, 1)
|
||||
ctx, _ = identity.WithServiceIdentity(ctx, 1)
|
||||
|
||||
fakeStore := &fakeDashboardStore{}
|
||||
r, err := NewDashboardFileReader(cfg, logger, nil, fakeStore, folderSvc)
|
||||
@@ -221,7 +221,7 @@ func TestDuplicatesValidator(t *testing.T) {
|
||||
duplicates := duplicateValidator.getDuplicates()
|
||||
|
||||
ctx := context.Background()
|
||||
ctx, _ = identity.WithServiceIdentitiy(ctx, 1)
|
||||
ctx, _ = identity.WithServiceIdentity(ctx, 1)
|
||||
|
||||
r, err := NewDashboardFileReader(cfg, logger, nil, fakeStore, folderSvc)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user