Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
Kubernetes-commit: a5f64b743e43687029173bd390854237a24b8579
  • Loading branch information
cici37 authored and k8s-publishing-bot committed Dec 7, 2023
1 parent 02998b3 commit ae9ed66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/cel/environment/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -64,13 +64,15 @@ 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{
cel.EvalOptions(cel.OptOptimize, cel.OptTrackCost),
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)),
},
},
Expand Down

0 comments on commit ae9ed66

Please sign in to comment.