From ff450934d18a7973667a19ed6a6723a503fcfcd0 Mon Sep 17 00:00:00 2001 From: Anders Eknert Date: Tue, 7 Mar 2023 07:46:46 +0100 Subject: [PATCH] decision logging: remove unused inter-query cache setup (#5731) Since a cache was created per request, this did not work as intended. As it's unlikely that http.send is used in decision log drop/masking decisions, it should be alright to leave this out until this is requested, if ever. Signed-off-by: Anders Eknert --- plugins/logs/plugin.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/logs/plugin.go b/plugins/logs/plugin.go index 684001986c..093fe586a3 100644 --- a/plugins/logs/plugin.go +++ b/plugins/logs/plugin.go @@ -29,7 +29,6 @@ import ( "github.com/open-policy-agent/opa/rego" "github.com/open-policy-agent/opa/server" "github.com/open-policy-agent/opa/storage" - "github.com/open-policy-agent/opa/topdown/cache" "github.com/open-policy-agent/opa/util" ) @@ -979,7 +978,6 @@ func (p *Plugin) dropEvent(ctx context.Context, txn storage.Transaction, event * if p.drop == nil { query := ast.NewBody(ast.NewExpr(ast.NewTerm(p.config.dropDecisionRef))) - interQueryCache := cache.NewInterQueryCache(p.manager.InterQueryBuiltinCacheConfig()) r := rego.New( rego.ParsedQuery(query), rego.Compiler(p.manager.GetCompiler()), @@ -988,7 +986,6 @@ func (p *Plugin) dropEvent(ctx context.Context, txn storage.Transaction, event * rego.Runtime(p.manager.Info), rego.EnablePrintStatements(p.manager.EnablePrintStatements()), rego.PrintHook(p.manager.PrintHook()), - rego.InterQueryBuiltinCache(interQueryCache), ) pq, err := r.PrepareForEval(context.Background())