Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 20 for CelType (1.26 sec)

  1. 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)
  2. 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)
  3. staging/src/k8s.io/apiserver/pkg/cel/mutation/mock_test.go

    	}
    }
    
    func (m *mockTypeRef) HasTrait(trait int) bool {
    	return common.ObjectTraits|trait != 0
    }
    
    func (m *mockTypeRef) TypeName() string {
    	return m.objectType.TypeName()
    }
    
    func (m *mockTypeRef) CELType() *types.Type {
    	return types.NewTypeTypeWithParam(m.objectType)
    }
    
    func (m *mockTypeRef) Field(name string) (*types.FieldType, bool) {
    	return &types.FieldType{
    		Type: types.DynType,
    		IsSet: func(target any) bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 24 00:01:35 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/compile.go

    				}
    				envOpts = append(envOpts,
    					cel.Variable(ObjectVarName, cel.DynType),
    					cel.Variable(OldObjectVarName, cel.DynType),
    					cel.Variable(NamespaceVarName, namespaceType.CelType()),
    					cel.Variable(RequestVarName, requestType.CelType()))
    
    				extended, err := baseEnv.Extend(
    					environment.VersionedOptions{
    						// Feature epoch was actually 1.26, but we artificially set it to 1.0 because these
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/cel/mutation/typeprovider.go

    // TypeProvider instead.
    func (p *TypeProvider) FindStructType(structType string) (*types.Type, bool) {
    	t, ok := p.typeResolver.Resolve(structType)
    	if ok {
    		return t.CELType(), true
    	}
    	return p.underlyingTypeProvider.FindStructType(structType)
    }
    
    // FindStructFieldNames returns the field names associated with the type, if the type
    // is found.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 15 21:02:36 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/cel/lazy/lazy_test.go

    		environment.VersionedOptions{
    			IntroducedVersion: version.MajorMinor(1, 28),
    			EnvOptions: []cel.EnvOption{
    				cel.Variable("variables", variablesType.CelType()),
    			},
    			DeclTypes: []*apiservercel.DeclType{
    				variablesType,
    			},
    		})
    	if err != nil {
    		return nil, nil, err
    	}
    	// TODO: change to NewExpressions after 1.28
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/authorization/cel/compile.go

    			// first version that supported this feature
    			IntroducedVersion: version.MajorMinor(1, 0),
    			EnvOptions: []cel.EnvOption{
    				cel.Variable(subjectAccessReviewRequestVarName, subjectAccessReviewSpecRequestType.CelType()),
    			},
    			DeclTypes: []*apiservercel.DeclType{
    				subjectAccessReviewSpecRequestType,
    			},
    		},
    	)
    	if err != nil {
    		panic(fmt.Sprintf("environment misconfigured: %v", err))
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Nov 02 20:56:52 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/cel/environment/environment.go

    	//    ...
    	//    VersionOptions{
    	//      IntroducedVersion: version.MajorMinor(1, 26),
    	//      DeclTypes: []*apiservercel.DeclType{ objectType },
    	//      EnvOptions: []cel.EnvOption{ cel.Variable("object", objectType.CelType()) },
    	//    },
    	//
    	// To create an DeclType from a CRD, use a structural schema. For example:
    	//
    	//    schema := structuralschema.NewStructural(crdJSONProps)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 08 15:52:31 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/typechecking.go

    func createVariableOpts(declType *apiservercel.DeclType, variables ...string) []cel.EnvOption {
    	opts := make([]cel.EnvOption, 0, len(variables))
    	t := cel.DynType
    	if declType != nil {
    		t = declType.CelType()
    	}
    	for _, v := range variables {
    		opts = append(opts, cel.Variable(v, t))
    	}
    	return opts
    }
    
    type typeCheckingCompiler struct {
    	compositionEnv *plugincel.CompositionEnv
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 15.3K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/ssagen/ssa.go

    	case t.IsString():
    		ptr := s.newValue1(ssa.OpStringPtr, s.f.Config.Types.BytePtr, right)
    		s.store(s.f.Config.Types.BytePtr, left, ptr)
    	case t.IsSlice():
    		elType := types.NewPtr(t.Elem())
    		ptr := s.newValue1(ssa.OpSlicePtr, elType, right)
    		s.store(elType, left, ptr)
    	case t.IsInterface():
    		// itab field is treated as a scalar.
    		idata := s.newValue1(ssa.OpIData, s.f.Config.Types.BytePtr, right)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 19:44:43 UTC 2024
    - 284.9K bytes
    - Viewed (0)
Back to top