Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for CelType (2.48 sec)

  1. staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go

    // the TypeProvider and the cost estimator.
    // List and map types are created on-demand with their parameters converted recursively.
    func convertCelTypeToDeclType(celType *cel.Type) *apiservercel.DeclType {
    	if celType == nil {
    		return apiservercel.DynType
    	}
    	switch celType {
    	case cel.AnyType:
    		return apiservercel.AnyType
    	case cel.BoolType:
    		return apiservercel.BoolType
    	case cel.BytesType:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 13 21:06:39 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/cel/mutation/common/interface.go

    	Resolve(name string) (TypeRef, bool)
    }
    
    // TypeRef refers an object type that can be looked up for its fields.
    type TypeRef interface {
    	ref.Type
    
    	// CELType wraps the TypeRef to be a type that is understood by CEL.
    	CELType() *types.Type
    
    	// Field finds the field by the field name, or false if the field is not known.
    	// This function directly return a FieldType that is known to CEL to be more customizable.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 24 00:01:35 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/cel/mutation/unstructured/typeref.go

    }
    
    // Val returns an instance given the fields.
    func (r *TypeRef) Val(fields map[string]ref.Val) ref.Val {
    	return common.NewObjectVal(r, fields)
    }
    
    // CELType returns the type. The returned type is of TypeType type.
    func (r *TypeRef) CELType() *types.Type {
    	return r.celTypeType
    }
    
    // Field looks up the field by name.
    // This is the unstructured version that allows any name as the field name.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 24 00:01:35 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go

    			EnvOptions: []cel.EnvOption{
    				cel.Variable(ScopedVarName, scopedType.CelType()),
    			},
    			DeclTypes: []*apiservercel.DeclType{
    				scopedType,
    			},
    		},
    		environment.VersionedOptions{
    			IntroducedVersion: version.MajorMinor(1, 24),
    			EnvOptions: []cel.EnvOption{
    				cel.Variable(OldScopedVarName, scopedType.CelType()),
    			},
    		},
    	)
    	if err != nil {
    		return nil, nil, err
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 20:13:14 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/cel/mutation/common/val.go

    func (v *ObjectVal) ConvertToType(typeValue ref.Type) ref.Val {
    	switch typeValue {
    	case v.typeRef:
    		return v
    	case types.TypeType:
    		return v.typeRef.CELType()
    	}
    	return types.NewErr("unsupported conversion into %v", typeValue)
    }
    
    // Equal returns true if the `other` value has the same type and content as the implementing struct.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Feb 27 21:55:08 UTC 2024
    - 4.2K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/authentication/cel/compile.go

    	envs[claimsVarName] = buildEnvSet([]cel.EnvOption{cel.Variable(claimsVarName, claimsType.CelType())}, []*apiservercel.DeclType{claimsType})
    	envs[userVarName] = buildEnvSet([]cel.EnvOption{cel.Variable(userVarName, userType.CelType())}, []*apiservercel.DeclType{userType})
    
    	return envs
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 08 17:59:05 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/authentication/cel/compile_test.go

    		fieldName := jsonTagParts[0]
    
    		declField, ok := userDeclType.Fields[fieldName]
    		if !ok {
    			t.Errorf("expected field %q to be present", field.Name)
    		}
    		if nativeTypeToCELType(t, field.Type).CelType().Equal(declField.Type.CelType()).Value() != true {
    			t.Errorf("expected field %q to have type %v, got %v", field.Name, field.Type, declField.Type)
    		}
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/cel/openapi/compiling_test.go

    		environment.VersionedOptions{
    			IntroducedVersion: version.MajorMinor(1, 26),
    			EnvOptions: []cel.EnvOption{
    				cel.Variable("foo", fooType.CelType()),
    				cel.Variable("bar", barType.CelType()),
    			},
    			DeclTypes: []*apiservercel.DeclType{
    				fooType,
    				barType,
    			},
    		},
    	)
    	if err != nil {
    		return nil, err
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/authorization/cel/compile_test.go

    		if !ok {
    			t.Fatalf("expected field %q to be present", nativeField.Name)
    		}
    		declFieldType := nativeTypeToCELType(t, nativeField.Type, field, fields)
    		if declFieldType != nil && declFieldType.CelType().Equal(declField.Type.CelType()).Value() != true {
    			return fmt.Errorf("expected native field %q to have type %v, got %v", nativeField.Name, nativeField.Type, declField.Type)
    		}
    	}
    	return nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/cel/environment/environment_test.go

    				{
    					IntroducedVersion: version.MajorMinor(1, 28),
    					DeclTypes:         []*apiservercel.DeclType{widgetsType},
    					EnvOptions: []cel.EnvOption{
    						cel.Variable("widget", widgetsType.CelType()),
    					},
    				},
    			},
    		},
    		{
    			name: "declared type enabled",
    			typeVersionCombinations: []envTypeAndVersion{
    				{version.MajorMinor(1, 28), NewExpressions},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 10K bytes
    - Viewed (0)
Back to top