From 7f91070d412278e69a73cc9f0cac614e9493b72c Mon Sep 17 00:00:00 2001 From: Christoph Mewes Date: Wed, 18 Oct 2023 16:50:31 +0200 Subject: [PATCH] adjust code to movel cel constants --- sdk/apis/test/cel.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/apis/test/cel.go b/sdk/apis/test/cel.go index 1dd8574bc14..ceae073b981 100644 --- a/sdk/apis/test/cel.go +++ b/sdk/apis/test/cel.go @@ -30,6 +30,7 @@ import ( "k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/yaml" + celconfig "k8s.io/apiserver/pkg/apis/cel" ) // FieldValidatorsFromFile extracts the CEL validators by version and JSONPath from a CRD file and returns @@ -76,7 +77,7 @@ func VersionValidatorsFromFile(t *testing.T, crdFilePath string) map[string]CELV structuralSchema, err := schema.NewStructural(&internalSchema) require.NoError(t, err, "failed to create StructuralSchema for version %s: %v", v.Name, err) ret[v.Name] = func(obj, old interface{}) field.ErrorList { - errs, _ := cel.NewValidator(structuralSchema, true, cel.RuntimeCELCostBudget).Validate(context.TODO(), nil, structuralSchema, obj, old, cel.PerCallLimit) + errs, _ := cel.NewValidator(structuralSchema, true, celconfig.RuntimeCELCostBudget).Validate(context.TODO(), nil, structuralSchema, obj, old, celconfig.PerCallLimit) return errs } } @@ -104,7 +105,7 @@ func findCEL(t *testing.T, s *schema.Structural, root bool, pth *field.Path) (ma s := *s pth := *pth ret[pth.String()] = func(obj, old interface{}) field.ErrorList { - errs, _ := cel.NewValidator(&s, root, cel.RuntimeCELCostBudget).Validate(context.TODO(), &pth, &s, obj, old, cel.PerCallLimit) + errs, _ := cel.NewValidator(&s, root, celconfig.RuntimeCELCostBudget).Validate(context.TODO(), &pth, &s, obj, old, celconfig.PerCallLimit) return errs } }