Use org service instead of sqlstore (#56407)

* Use org service instead of sqlstore

* Remove methods from sqlstore

* Remove commented out code

* Fix lint

* Fix lint 2
This commit is contained in:
idafurjes
2022-10-13 08:40:46 -04:00
committed by GitHub
parent b0cb02568a
commit ef651daed2
20 changed files with 164 additions and 267 deletions
@@ -9,14 +9,15 @@ import (
"strings"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/provisioning/utils"
"gopkg.in/yaml.v2"
)
type configReader struct {
path string
log log.Logger
orgStore utils.OrgStore
path string
log log.Logger
orgService org.Service
}
func (cr *configReader) parseConfigs(file fs.DirEntry) ([]*config, error) {
@@ -94,7 +95,7 @@ func (cr *configReader) readConfig(ctx context.Context) ([]*config, error) {
dashboard.OrgID = 1
}
if err := utils.CheckOrgExists(ctx, cr.orgStore, dashboard.OrgID); err != nil {
if err := utils.CheckOrgExists(ctx, cr.orgService, dashboard.OrgID); err != nil {
return nil, fmt.Errorf("failed to provision dashboards with %q reader: %w", dashboard.Name, err)
}