[Chore] update to cue v0.4.0 (#39641)

* change global flag to flagset

* update pr with comments

* replace flag.args by flagset

* fix build

* migrate the schema package to use cue 4.0

* fix the load package
This commit is contained in:
ying-jeanne
2021-09-28 11:09:09 -04:00
committed by GitHub
parent 05bb451a1d
commit 580cdc46fc
10 changed files with 85 additions and 74 deletions
+8 -10
View File
@@ -30,13 +30,12 @@ func TestGenerate(t *testing.T) {
for _, c := range cases {
t.Run(c.Name+" apply default value", func(t *testing.T) {
var r cue.Runtime
scmInstance, err := r.Compile(c.Name+".cue", c.CUE)
if err != nil {
t.Fatal(err)
scmInstance := ctx.CompileString(c.CUE, cue.Filename(c.Name+".cue"))
if scmInstance.Err() != nil {
t.Fatal(scmInstance.Err())
}
inputResource := Resource{Value: c.Trimmed}
out, err := ApplyDefaults(inputResource, scmInstance.Value())
out, err := ApplyDefaults(inputResource, scmInstance)
if err != nil {
t.Fatal(err)
}
@@ -50,13 +49,12 @@ func TestGenerate(t *testing.T) {
for _, c := range cases {
t.Run(c.Name+" trim default value", func(t *testing.T) {
var r cue.Runtime
scmInstance, err := r.Compile(c.Name+".cue", c.CUE)
if err != nil {
t.Fatal(err)
scmInstance := ctx.CompileString(c.CUE, cue.Filename(c.Name+".cue"))
if scmInstance.Err() != nil {
t.Fatal(scmInstance.Err())
}
inputResource := Resource{Value: c.Full}
out, err := TrimDefaults(inputResource, scmInstance.Value())
out, err := TrimDefaults(inputResource, scmInstance)
if err != nil {
t.Fatal(err)
}