mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	Provisioning: describe which folder caused an error while provisioning from files structure (#26771)
* Provisioning: describe which folder caused an error while provisioning from files structure Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com> * Apply suggestions from code review Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove unused DashType constants Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
		@@ -10,14 +10,12 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/grafana/grafana/pkg/services/dashboards"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/util"
 | 
			
		||||
 | 
			
		||||
	"github.com/grafana/grafana/pkg/bus"
 | 
			
		||||
 | 
			
		||||
	"github.com/grafana/grafana/pkg/components/simplejson"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/infra/log"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/models"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/services/dashboards"
 | 
			
		||||
	"github.com/grafana/grafana/pkg/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
@@ -148,7 +146,7 @@ func (fr *FileReader) storeDashboardsInFoldersFromFileStructure(filesFoundOnDisk
 | 
			
		||||
 | 
			
		||||
		folderID, err := getOrCreateFolderID(fr.Cfg, fr.dashboardProvisioningService, folderName)
 | 
			
		||||
		if err != nil && err != ErrFolderNameMissing {
 | 
			
		||||
			return err
 | 
			
		||||
			return fmt.Errorf("can't provision folder %q from file system structure: %w", folderName, err)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		provisioningMetadata, err := fr.saveDashboard(path, folderID, fileInfo, dashboardRefs)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user