Scuemata: Add grafana-cli command to validate basic scuemata (#33523)
* Add grafana-cli command to validate basic scuemata * Fix c/p outdated message * Fix linting - naming * Add basic testing * Add cue schema validation * Add tests * Fix linting errors * Remove code - refactored tests * Remove unnecessary files - leftovers * Fix linting * Try adding public folder in testdata
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"cuelang.org/go/cue"
|
||||
"cuelang.org/go/cue/load"
|
||||
"github.com/grafana/grafana"
|
||||
)
|
||||
|
||||
var rt = &cue.Runtime{}
|
||||
@@ -39,6 +40,13 @@ type BaseLoadPaths struct {
|
||||
InstanceCueFS fs.FS
|
||||
}
|
||||
|
||||
func GetDefaultLoadPaths() BaseLoadPaths {
|
||||
return BaseLoadPaths{
|
||||
BaseCueFS: grafana.CoreSchema,
|
||||
DistPluginCueFS: grafana.PluginSchema,
|
||||
}
|
||||
}
|
||||
|
||||
// toOverlay converts all .cue files in the fs.FS into Source entries in an
|
||||
// overlay map, as expected by load.Config.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user