mirror of
https://github.com/grafana/grafana.git
synced 2024-11-24 09:50:29 -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/errors"
|
||||
"github.com/grafana/thema"
|
||||
tload "github.com/grafana/thema/load"
|
||||
|
||||
"github.com/grafana/grafana"
|
||||
"github.com/grafana/grafana/pkg/cuectx"
|
||||
"github.com/grafana/thema"
|
||||
)
|
||||
|
||||
// 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) {
|
||||
var v cue.Value
|
||||
var err error
|
||||
|
||||
bi, err := tload.InstancesWithThema(grafana.CueSchemaFS, prefix)
|
||||
v, err := cuectx.BuildGrafanaInstance(ctx, filepath.Join("pkg", "kindsys"), "kindsys", nil)
|
||||
if err != nil {
|
||||
return v, err
|
||||
}
|
||||
v = ctx.BuildInstance(bi)
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user