Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 17 of 17 for toolType (0.1 sec)

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

    	Expression string
    }
    
    func (v *fakeValidationCondition) GetExpression() string {
    	return v.Expression
    }
    
    func (v *fakeValidationCondition) ReturnTypes() []*celgo.Type {
    	return []*celgo.Type{celgo.BoolType}
    }
    
    type fakeAuditAnnotationCondition struct {
    	ValueExpression string
    }
    
    func (v *fakeAuditAnnotationCondition) GetExpression() string {
    	return v.ValueExpression
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/cel/common/schemas.go

    			} else {
    				strWithMaxLength.MaxElements = estimateMaxStringLengthPerRequest(s)
    			}
    		}
    		return strWithMaxLength
    	case "boolean":
    		return apiservercel.BoolType
    	case "number":
    		return apiservercel.DoubleType
    	case "integer":
    		return apiservercel.IntType
    	}
    	return nil
    }
    
    func zeroIfNegative(v int64) int64 {
    	if v < 0 {
    		return 0
    	}
    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/apiserver/pkg/cel/value_test.go

    )
    
    func TestConvertToType(t *testing.T) {
    	objType := NewObjectType("TestObject", map[string]*DeclField{})
    	tests := []struct {
    		val interface{}
    		typ ref.Type
    	}{
    		{true, types.BoolType},
    		{float64(1.2), types.DoubleType},
    		{int64(-42), types.IntType},
    		{uint64(63), types.UintType},
    		{time.Duration(300), types.DurationType},
    		{time.Now().UTC(), types.TimestampType},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 10 22:05:55 UTC 2022
    - 10.4K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/compilation.go

    	if issues != nil {
    		compilationResult.Error = &apiservercel.Error{Type: apiservercel.ErrorTypeInvalid, Detail: "compilation failed: " + issues.String()}
    		return
    	}
    	if ast.OutputType() != cel.BoolType {
    		compilationResult.Error = &apiservercel.Error{Type: apiservercel.ErrorTypeInvalid, Detail: "cel expression must evaluate to a bool"}
    		return
    	}
    
    	checkedExpr, err := cel.AstToCheckedExpr(ast)
    	if err != nil {
    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/value.go

    func (dv *DynValue) Type() ref.Type {
    	return dv.ExprValue().Type()
    }
    
    func exprValue(value interface{}) (ref.Val, *DeclType, error) {
    	switch v := value.(type) {
    	case bool:
    		return types.Bool(v), BoolType, nil
    	case []byte:
    		return types.Bytes(v), BytesType, nil
    	case float64:
    		return types.Double(v), DoubleType, nil
    	case int64:
    		return types.Int(v), IntType, nil
    	case string:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 10 22:05:55 UTC 2022
    - 20.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/filter_test.go

    )
    
    type condition struct {
    	Expression string
    }
    
    func (c *condition) GetExpression() string {
    	return c.Expression
    }
    
    func (v *condition) ReturnTypes() []*celgo.Type {
    	return []*celgo.Type{celgo.BoolType}
    }
    
    func TestCompile(t *testing.T) {
    	cases := []struct {
    		name             string
    		validation       []ExpressionAccessor
    		errorExpressions map[string]string
    	}{
    		{
    			name: "invalid syntax",
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 40.4K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/plugin/pkg/authenticator/token/oidc/oidc.go

    func checkValidationRulesEvaluation(results []authenticationcel.EvaluationResult, messageFn messageFunc) error {
    	for _, result := range results {
    		if result.EvalResult.Type() != celgo.BoolType {
    			return fmt.Errorf("validation expression must return a boolean")
    		}
    		if !result.EvalResult.Value().(bool) {
    			expression := result.ExpressionAccessor.GetExpression()
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Mar 09 19:29:33 UTC 2024
    - 37.9K bytes
    - Viewed (0)
Back to top