Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for SchemaDeclType (0.2 sec)

  1. staging/src/k8s.io/apiserver/pkg/cel/openapi/compiling_test.go

    // bar is an object with a string field "bar", an integer field "common", and an integer field "confusion"
    func buildTestEnv() (*cel.Env, error) {
    	fooType := common.SchemaDeclType(simpleMapSchema("foo", spec.StringProperty()), true).MaybeAssignTypeName("fooType")
    	barType := common.SchemaDeclType(simpleMapSchema("bar", spec.Int64Property()), true).MaybeAssignTypeName("barType")
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/cel/common/schemas.go

    	"github.com/google/cel-go/common/types"
    
    	apiservercel "k8s.io/apiserver/pkg/cel"
    	"k8s.io/kube-openapi/pkg/validation/spec"
    )
    
    const maxRequestSizeBytes = apiservercel.DefaultMaxRequestSizeBytes
    
    // SchemaDeclType converts the structural schema to a CEL declaration, or returns nil if the
    // structural schema should not be exposed in CEL expressions.
    // Set isResourceRoot to true for the root of a custom resource or embedded resource.
    //
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 09 18:00:45 UTC 2023
    - 10.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/schemas.go

    // if their schema is not exposed.
    //
    // The CEL declaration for objects with XPreserveUnknownFields does not expose unknown fields.
    func SchemaDeclType(s *schema.Structural, isResourceRoot bool) *apiservercel.DeclType {
    	return common.SchemaDeclType(&Structural{Structural: s}, isResourceRoot)
    }
    
    // WithTypeAndObjectMeta ensures the kind, apiVersion and
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 20:13:14 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/cel/openapi/adaptor.go

    }
    
    func UnstructuredToVal(unstructured any, schema *spec.Schema) ref.Val {
    	return common.UnstructuredToVal(unstructured, &Schema{schema})
    }
    
    func SchemaDeclType(s *spec.Schema, isResourceRoot bool) *apiservercel.DeclType {
    	return common.SchemaDeclType(&Schema{Schema: s}, isResourceRoot)
    }
    
    func MakeMapList(sts *spec.Schema, items []interface{}) (rv common.MapList) {
    	return common.MakeMapList(&Schema{Schema: sts}, items)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 10 21:26:55 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/schemas_test.go

    	"google.golang.org/protobuf/proto"
    
    	"k8s.io/apiextensions-apiserver/pkg/apiserver/schema"
    	apiservercel "k8s.io/apiserver/pkg/cel"
    )
    
    func TestSchemaDeclType(t *testing.T) {
    	ts := testSchema()
    	cust := SchemaDeclType(ts, false)
    	if cust.TypeName() != "object" {
    		t.Errorf("incorrect type name, got %v, wanted object", cust.TypeName())
    	}
    	if len(cust.Fields) != 4 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 20:13:14 UTC 2024
    - 14K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/cel/openapi/schemas_test.go

    	"google.golang.org/protobuf/proto"
    
    	apiservercel "k8s.io/apiserver/pkg/cel"
    	"k8s.io/kube-openapi/pkg/validation/spec"
    )
    
    func TestSchemaDeclType(t *testing.T) {
    	ts := testSchema()
    	cust := SchemaDeclType(ts, false)
    	if cust.TypeName() != "object" {
    		t.Errorf("incorrect type name, got %v, wanted object", cust.TypeName())
    	}
    	if len(cust.Fields) != 4 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Dec 14 17:18:27 UTC 2022
    - 13K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/cel/environment/environment.go

    	// populate a VersionedOptions with the variable and the type:
    	//
    	//    schema := schemaResolver.ResolveSchema(groupVersionKind)
    	//    objectType := apiservercel.SchemaDeclType(schema, true)
    	//    ...
    	//    VersionOptions{
    	//      IntroducedVersion: version.MajorMinor(1, 26),
    	//      DeclTypes: []*apiservercel.DeclType{ objectType },
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 08 15:52:31 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/types_test.go

    	apiservercel "k8s.io/apiserver/pkg/cel"
    )
    
    func TestTypes_RuleTypesFieldMapping(t *testing.T) {
    	stdEnv, _ := cel.NewEnv()
    	rt := apiservercel.NewDeclTypeProvider(SchemaDeclType(testSchema(), true).MaybeAssignTypeName("CustomObject"))
    	nestedFieldType, found := rt.FindFieldType("CustomObject", "nested")
    	if !found {
    		t.Fatal("got field not found for 'CustomObject.nested', wanted found")
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 08 15:52:31 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation_test.go

    			if err != nil {
    				t.Fatal(err)
    			}
    			loader := NewExpressionsEnvLoader()
    			if tt.unmodified {
    				loader = StoredExpressionsEnvLoader()
    			}
    			compilationResults, err := Compile(&tt.input, model.SchemaDeclType(&tt.input, false), celconfig.PerCallLimit, env, loader)
    			if err != nil {
    				t.Fatalf("Expected no error, but got: %v", err)
    			}
    
    			if len(compilationResults) != len(tt.input.XValidations) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 20:13:14 UTC 2024
    - 51.5K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/typechecking.go

    	if gvk.Empty() {
    		return nil, nil
    	}
    	s, err := c.SchemaResolver.ResolveSchema(gvk)
    	if err != nil {
    		return nil, err
    	}
    	return common.SchemaDeclType(&openapi.Schema{Schema: s}, true).MaybeAssignTypeName(generateUniqueTypeName(gvk.Kind)), nil
    }
    
    func (c *TypeChecker) paramsGVK(policy *v1.ValidatingAdmissionPolicy) schema.GroupVersionKind {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 15.3K bytes
    - Viewed (0)
Back to top