From 5eeed90a5c890ddc6b73f8884cf3c4abaa7ba13f Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Thu, 17 Jul 2025 18:40:16 +0200 Subject: [PATCH] runtime: allow enabling NDBCache by default (#7780) Signed-off-by: Stephan Renatus --- v1/runtime/runtime.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/v1/runtime/runtime.go b/v1/runtime/runtime.go index b7345042af..206340cae1 100644 --- a/v1/runtime/runtime.go +++ b/v1/runtime/runtime.go @@ -259,6 +259,9 @@ type Params struct { // Hooks is our generic extension mechanism. Hooks hooks.Hooks + + // NDBCacheEnabled allows enabling the non-deterministic builtin cache globally. + NDBCacheEnabled bool } func (p *Params) regoVersion() ast.RegoVersion { @@ -636,11 +639,12 @@ func (rt *Runtime) Serve(ctx context.Context) error { WithMinTLSVersion(rt.Params.MinTLSVersion). WithCipherSuites(rt.Params.CipherSuites). WithDistributedTracingOpts(rt.Params.DistributedTracingOpts). - WithHooks(rt.Params.Hooks) + WithHooks(rt.Params.Hooks). + WithNDBCacheEnabled(rt.Params.NDBCacheEnabled) // If decision_logging plugin enabled, check to see if we opted in to the ND builtins cache. if lp := logs.Lookup(rt.Manager); lp != nil { - rt.server = rt.server.WithNDBCacheEnabled(rt.Manager.Config.NDBuiltinCacheEnabled()) + rt.server = rt.server.WithNDBCacheEnabled(rt.Params.NDBCacheEnabled || rt.Manager.Config.NDBuiltinCacheEnabled()) } if rt.Params.DiagnosticAddrs != nil {