Address comment
This commit is contained in:
		@@ -18,13 +18,13 @@ package environment
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"github.com/google/cel-go/checker"
 | 
			
		||||
	"github.com/google/cel-go/interpreter"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"sync"
 | 
			
		||||
 | 
			
		||||
	"github.com/google/cel-go/cel"
 | 
			
		||||
	"github.com/google/cel-go/checker"
 | 
			
		||||
	"github.com/google/cel-go/ext"
 | 
			
		||||
	"github.com/google/cel-go/interpreter"
 | 
			
		||||
	"golang.org/x/sync/singleflight"
 | 
			
		||||
 | 
			
		||||
	"k8s.io/apimachinery/pkg/util/version"
 | 
			
		||||
@@ -64,6 +64,7 @@ var baseOpts = []VersionedOptions{
 | 
			
		||||
			library.Lists(),
 | 
			
		||||
 | 
			
		||||
			// cel-go v0.17.7 change the cost of has() from 0 to 1, but also provided the CostEstimatorOptions option to preserve the old behavior, so we enabled it at the same time we bumped our cel version to v0.17.7.
 | 
			
		||||
			// Since it is a regression fix, we apply it uniformly to all code use v0.17.7.
 | 
			
		||||
			cel.CostEstimatorOptions(checker.PresenceTestHasCost(false)),
 | 
			
		||||
		},
 | 
			
		||||
		ProgramOptions: []cel.ProgramOption{
 | 
			
		||||
@@ -71,6 +72,7 @@ var baseOpts = []VersionedOptions{
 | 
			
		||||
			cel.CostLimit(celconfig.PerCallLimit),
 | 
			
		||||
 | 
			
		||||
			// cel-go v0.17.7 change the cost of has() from 0 to 1, but also provided the CostEstimatorOptions option to preserve the old behavior, so we enabled it at the same time we bumped our cel version to v0.17.7.
 | 
			
		||||
			// Since it is a regression fix, we apply it uniformly to all code use v0.17.7.
 | 
			
		||||
			cel.CostTrackerOptions(interpreter.PresenceTestHasCost(false)),
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user