mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	ProvisioningService: Change the ProvisioningService interface for easier extension (#32910)
* Made a public constructor in order to instantiate it from the service override * Removed unused plugins.DataRequestHandler * Added a Run and RunInitProvisioners methods that can be run from Enterprise * Adding a mock for Run and RunInitProvisioners as well
This commit is contained in:
		@@ -9,7 +9,6 @@ import (
 | 
			
		||||
	"github.com/grafana/grafana/pkg/dashboards"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/infra/log"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/models"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/plugins"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/util/errutil"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
@@ -24,7 +23,7 @@ type DashboardProvisioner interface {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DashboardProvisionerFactory creates DashboardProvisioners based on input
 | 
			
		||||
type DashboardProvisionerFactory func(string, dashboards.Store, plugins.DataRequestHandler) (DashboardProvisioner, error)
 | 
			
		||||
type DashboardProvisionerFactory func(string, dashboards.Store) (DashboardProvisioner, error)
 | 
			
		||||
 | 
			
		||||
// Provisioner is responsible for syncing dashboard from disk to Grafana's database.
 | 
			
		||||
type Provisioner struct {
 | 
			
		||||
@@ -34,7 +33,7 @@ type Provisioner struct {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// New returns a new DashboardProvisioner
 | 
			
		||||
func New(configDirectory string, store dashboards.Store, reqHandler plugins.DataRequestHandler) (DashboardProvisioner, error) {
 | 
			
		||||
func New(configDirectory string, store dashboards.Store) (DashboardProvisioner, error) {
 | 
			
		||||
	logger := log.New("provisioning.dashboard")
 | 
			
		||||
	cfgReader := &configReader{path: configDirectory, log: logger}
 | 
			
		||||
	configs, err := cfgReader.readConfig()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user