Skip to content

Commit e9ca3ed

Browse files
committed
rego: remove superfluous package import of plugins
Fixes #6754. The PR message of #5939 indicates that the plugin manager is NOT used for this. And where was nothing in the code setting `pluginMgr`. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
1 parent 55683c7 commit e9ca3ed

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

v1/rego/rego.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"github.com/open-policy-agent/opa/v1/loader"
2828
"github.com/open-policy-agent/opa/v1/loader/filter"
2929
"github.com/open-policy-agent/opa/v1/metrics"
30-
"github.com/open-policy-agent/opa/v1/plugins"
3130
"github.com/open-policy-agent/opa/v1/resolver"
3231
"github.com/open-policy-agent/opa/v1/storage"
3332
"github.com/open-policy-agent/opa/v1/storage/inmem"
@@ -666,8 +665,6 @@ type Rego struct {
666665
enablePrintStatements bool
667666
distributedTracingOpts tracing.Options
668667
strict bool
669-
pluginMgr *plugins.Manager
670-
plugins []TargetPlugin
671668
targetPrepState TargetPluginEval
672669
regoVersion ast.RegoVersion
673670
compilerHook func(*ast.Compiler)
@@ -1428,15 +1425,6 @@ func New(options ...func(r *Rego)) *Rego {
14281425
r.generateJSON = generateJSON
14291426
}
14301427

1431-
if r.pluginMgr != nil {
1432-
for _, pluginName := range r.pluginMgr.Plugins() {
1433-
p := r.pluginMgr.Plugin(pluginName)
1434-
if p0, ok := p.(TargetPlugin); ok {
1435-
r.plugins = append(r.plugins, p0)
1436-
}
1437-
}
1438-
}
1439-
14401428
if t := r.targetPlugin(r.target); t != nil {
14411429
r.compiler = r.compiler.WithEvalMode(ast.EvalModeIR)
14421430
}

0 commit comments

Comments
 (0)