Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Pushpalanka Jayawardhana <[email protected]>
  • Loading branch information
Pushpalanka committed Jan 13, 2025
1 parent f121a57 commit cc8fb1a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions filters/openpolicyagent/openpolicyagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ type OpenPolicyAgentRegistry struct {
bodyReadBufferSize int64

tracer opentracing.Tracer

preevaluationOptimization bool
}

type OpenPolicyAgentFilter interface {
Expand Down Expand Up @@ -762,14 +760,8 @@ func (opa *OpenPolicyAgentInstance) CreatePreparedQueryOnce(opts envoyauth.Prepa
opa.preparedQueryDoOnce.Do(func() {
regoOpts := append(opts.Opts, rego.DistributedTracingOpts(opa.DistributedTracing()))

prepareOpts := opts.PrepareOpts

if opa.registry.preevaluationOptimization {
prepareOpts = append(prepareOpts, rego.WithPartialEval())
}

pq, err := rego.New(regoOpts...).
PrepareForEval(context.Background(), prepareOpts...)
PrepareForEval(context.Background())

opa.preparedQuery = &pq
opa.preparedQueryErr = err
Expand Down

0 comments on commit cc8fb1a

Please sign in to comment.