Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for isQuantity (0.36 sec)

  1. staging/src/k8s.io/apiserver/pkg/cel/library/quantity.go

    //	quantity('Mi') // error
    //
    // isQuantity
    //
    // Returns true if a string is a valid Quantity. isQuantity returns true if and
    // only if quantity does not result in error.
    //
    //	isQuantity( <string>) <bool>
    //
    // Examples:
    //
    //	isQuantity('1.3G') // returns true
    //	isQuantity('1.3Gi') // returns true
    //	isQuantity('1,3G') // returns false
    //	isQuantity('10000k') // returns true
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Aug 23 21:31:27 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/cel/library/quantity_test.go

    		},
    		{
    			name:        "isQuantity",
    			expr:        `isQuantity("20")`,
    			expectValue: trueVal,
    		},
    		{
    			name:        "isQuantity_megabytes",
    			expr:        `isQuantity("20M")`,
    			expectValue: trueVal,
    		},
    		{
    			name:        "isQuantity_mebibytes",
    			expr:        `isQuantity("20Mi")`,
    			expectValue: trueVal,
    		},
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 17:22:44 UTC 2024
    - 8.6K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/cel/library/library_compatibility_test.go

    		// Kubernetes <1.28>:
    		"errored", "error",
    		// Kubernetes <1.29>:
    		"add", "asApproximateFloat", "asInteger", "compareTo", "isGreaterThan", "isInteger", "isLessThan", "isQuantity", "quantity", "sign", "sub",
    		// Kubernetes <1.30>:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 12:03:04 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/celcoststability_test.go

    			},
    		},
    		{name: "quantity",
    			obj:    objs("20", "200M"),
    			schema: schemas(stringType, stringType),
    			expectCost: map[string]int64{
    				`isQuantity(self.val1)`: 3,
    				`isQuantity(self.val2)`: 3,
    				`isQuantity("200M")`:    1,
    				`isQuantity("20Mi")`:    1,
    				`quantity("200M") == quantity("0.2G") && quantity("0.2G") == quantity("200M")`:                                           6,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 28 19:20:16 UTC 2024
    - 80.2K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/cel/library/cost.go

    				cost += uint64(math.Ceil(float64(otherSize) * common.StringTraversalCostFactor))
    			}
    
    			return &cost
    		}
    	case "quantity", "isQuantity":
    		if len(args) >= 1 {
    			cost := uint64(math.Ceil(float64(actualSize(args[0])) * common.StringTraversalCostFactor))
    			return &cost
    		}
    	case "validate":
    		if len(args) >= 2 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 17:22:44 UTC 2024
    - 20.6K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/cel/library/cost_test.go

    			expectRuntimeCost:   1,
    		},
    		{
    			name:                "isQuantity",
    			expr:                `isQuantity("20")`,
    			expectEstimatedCost: checker.CostEstimate{Min: 1, Max: 1},
    			expectRuntimeCost:   1,
    		},
    		{
    			name:                "isQuantity_megabytes",
    			expr:                `isQuantity("20M")`,
    			expectEstimatedCost: checker.CostEstimate{Min: 1, Max: 1},
    			expectRuntimeCost:   1,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 17:22:44 UTC 2024
    - 40.8K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go

    			},
    		},
    		{name: "quantity",
    			obj:    objs("20", "200M"),
    			schema: schemas(stringType, stringType),
    			valid: []string{
    				"isQuantity(self.val1)",
    				"isQuantity(self.val2)",
    				`isQuantity("20Mi")`,
    				`quantity(self.val2) == quantity("0.2G") && quantity("0.2G") == quantity("200M")`,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 17:14:10 UTC 2024
    - 159.9K bytes
    - Viewed (0)
Back to top