mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
kindsys: Fix loading on windows (#59519)
This commit is contained in:
parent
823a40bc85
commit
ce0bdb2cd9
@ -8,11 +8,8 @@ import (
|
|||||||
|
|
||||||
"cuelang.org/go/cue"
|
"cuelang.org/go/cue"
|
||||||
"cuelang.org/go/cue/errors"
|
"cuelang.org/go/cue/errors"
|
||||||
"github.com/grafana/thema"
|
|
||||||
tload "github.com/grafana/thema/load"
|
|
||||||
|
|
||||||
"github.com/grafana/grafana"
|
|
||||||
"github.com/grafana/grafana/pkg/cuectx"
|
"github.com/grafana/grafana/pkg/cuectx"
|
||||||
|
"github.com/grafana/thema"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CoreStructuredDeclParentPath is the path, relative to the repository root, where
|
// CoreStructuredDeclParentPath is the path, relative to the repository root, where
|
||||||
@ -49,20 +46,14 @@ func loadpFrameworkOnce() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var prefix = filepath.Join("/pkg", "kindsys")
|
|
||||||
|
|
||||||
func doLoadFrameworkCUE(ctx *cue.Context) (cue.Value, error) {
|
func doLoadFrameworkCUE(ctx *cue.Context) (cue.Value, error) {
|
||||||
var v cue.Value
|
v, err := cuectx.BuildGrafanaInstance(ctx, filepath.Join("pkg", "kindsys"), "kindsys", nil)
|
||||||
var err error
|
|
||||||
|
|
||||||
bi, err := tload.InstancesWithThema(grafana.CueSchemaFS, prefix)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return v, err
|
return v, err
|
||||||
}
|
}
|
||||||
v = ctx.BuildInstance(bi)
|
|
||||||
|
|
||||||
if err = v.Validate(cue.Concrete(false), cue.All()); err != nil {
|
if err = v.Validate(cue.Concrete(false), cue.All()); err != nil {
|
||||||
return cue.Value{}, fmt.Errorf("coremodel framework loaded cue.Value has err: %w", err)
|
return cue.Value{}, fmt.Errorf("kindsys framework loaded cue.Value has err: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user