[v9.5.x] Provisioning: Look up provisioned folders by UID when possible (#87504)
Provisioning: Look up provisioned folders by UID when possible (#87465)
look up provisioned folders by uid when possible
(cherry picked from commit 1884b03511)
This commit is contained in:
@@ -299,10 +299,16 @@ func (fr *FileReader) getOrCreateFolderID(ctx context.Context, cfg *config, serv
|
||||
}
|
||||
|
||||
cmd := &dashboards.GetDashboardQuery{
|
||||
Title: &folderName,
|
||||
FolderID: util.Pointer(int64(0)),
|
||||
FolderID: util.Pointer(int64(0)), // nolint:staticcheck
|
||||
OrgID: cfg.OrgID,
|
||||
}
|
||||
|
||||
if cfg.FolderUID != "" {
|
||||
cmd.UID = cfg.FolderUID
|
||||
} else {
|
||||
cmd.Title = &folderName
|
||||
}
|
||||
|
||||
result, err := fr.dashboardStore.GetDashboard(ctx, cmd)
|
||||
|
||||
if err != nil && !errors.Is(err, dashboards.ErrDashboardNotFound) {
|
||||
|
||||
Reference in New Issue
Block a user