mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-07 22:03:22 +00:00
Bump cel-go to v0.10.1
This commit is contained in:
2
vendor/github.com/google/cel-go/interpreter/decorators.go
generated
vendored
2
vendor/github.com/google/cel-go/interpreter/decorators.go
generated
vendored
@@ -259,8 +259,6 @@ func maybeOptimizeSetMembership(i Interpretable, inlist InterpretableCall) (Inte
|
||||
if !types.IsError(iv) {
|
||||
valueSet[iv] = types.True
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
return &evalSetMembership{
|
||||
|
||||
7
vendor/github.com/google/cel-go/interpreter/interpreter.go
generated
vendored
7
vendor/github.com/google/cel-go/interpreter/interpreter.go
generated
vendored
@@ -101,8 +101,6 @@ func EvalStateObserver(state EvalState) EvalObserver {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Replace all usages of ExhaustiveEval with ExhaustiveEvalWrapper
|
||||
|
||||
// ExhaustiveEval replaces operations that short-circuit with versions that evaluate
|
||||
// expressions and couples this behavior with the TrackState() decorator to provide
|
||||
// insight into the evaluation state of the entire expression. EvalState must be
|
||||
@@ -115,6 +113,11 @@ func ExhaustiveEval() InterpretableDecorator {
|
||||
}
|
||||
}
|
||||
|
||||
// InterruptableEval annotates comprehension loops with information that indicates they
|
||||
// should check the `#interrupted` state within a custom Activation.
|
||||
//
|
||||
// The custom activation is currently managed higher up in the stack within the 'cel' package
|
||||
// and should not require any custom support on behalf of callers.
|
||||
func InterruptableEval() InterpretableDecorator {
|
||||
return decInterruptFolds()
|
||||
}
|
||||
|
||||
18
vendor/github.com/google/cel-go/interpreter/runtimecost.go
generated
vendored
18
vendor/github.com/google/cel-go/interpreter/runtimecost.go
generated
vendored
@@ -12,10 +12,6 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package interpreter provides functions to evaluate parsed expressions with
|
||||
// the option to augment the evaluation with inputs and functions supplied at
|
||||
// evaluation time.
|
||||
|
||||
package interpreter
|
||||
|
||||
import (
|
||||
@@ -35,7 +31,7 @@ import (
|
||||
// estimate to provide. CEL attempts to provide reasonable estimates for its standard function library, so CallCost
|
||||
// should typically not need to provide an estimate for CELs standard function.
|
||||
type ActualCostEstimator interface {
|
||||
CallCost(overloadId string, args []ref.Val) *uint64
|
||||
CallCost(function, overloadID string, args []ref.Val, result ref.Val) *uint64
|
||||
}
|
||||
|
||||
// CostObserver provides an observer that tracks runtime cost.
|
||||
@@ -46,7 +42,7 @@ func CostObserver(tracker *CostTracker) EvalObserver {
|
||||
// TODO: Push identifiers on to the stack before observing constant qualifiers that apply to them
|
||||
// and enable the below pop. Once enabled this can case can be collapsed into the Qualifier case.
|
||||
//tracker.stack.pop(1)
|
||||
tracker.cost += 1
|
||||
tracker.cost++
|
||||
case InterpretableConst:
|
||||
// zero cost
|
||||
case InterpretableAttribute:
|
||||
@@ -59,10 +55,10 @@ func CostObserver(tracker *CostTracker) EvalObserver {
|
||||
// Ternary has no direct cost. All cost is from the conditional and the true/false branch expressions.
|
||||
case Qualifier:
|
||||
tracker.stack.pop(1)
|
||||
tracker.cost += 1
|
||||
tracker.cost++
|
||||
case InterpretableCall:
|
||||
if argVals, ok := tracker.stack.pop(len(t.Args())); ok {
|
||||
tracker.cost += tracker.costCall(t, argVals)
|
||||
tracker.cost += tracker.costCall(t, argVals, val)
|
||||
}
|
||||
case InterpretableConstructor:
|
||||
switch t.Type() {
|
||||
@@ -97,10 +93,10 @@ func (c CostTracker) ActualCost() uint64 {
|
||||
return c.cost
|
||||
}
|
||||
|
||||
func (c CostTracker) costCall(call InterpretableCall, argValues []ref.Val) uint64 {
|
||||
func (c CostTracker) costCall(call InterpretableCall, argValues []ref.Val, result ref.Val) uint64 {
|
||||
var cost uint64
|
||||
if c.Estimator != nil {
|
||||
callCost := c.Estimator.CallCost(call.OverloadID(), argValues)
|
||||
callCost := c.Estimator.CallCost(call.Function(), call.OverloadID(), argValues, result)
|
||||
if callCost != nil {
|
||||
cost += *callCost
|
||||
return cost
|
||||
@@ -160,7 +156,7 @@ func (c CostTracker) costCall(call InterpretableCall, argValues []ref.Val) uint6
|
||||
// - Computing the size of strings, byte sequences, lists and maps.
|
||||
// - Logical operations and all operators on fixed width scalars (comparisons, equality)
|
||||
// - Any functions that don't have a declared cost either here or in provided ActualCostEstimator.
|
||||
cost += 1
|
||||
cost++
|
||||
|
||||
}
|
||||
return cost
|
||||
|
||||
Reference in New Issue
Block a user