mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
Fixing issue where bundle plugin could panic on reconfiguration (SDK use) (#7300)
Fixing issue where bundle plugin would panic on reconfiguration if module rego-version is missing in bundle manifest. * Passing runtime rego-version to deactivation options * Preferring to pull rego-version from parsed modules if present This solves an edge case when using the OPA SDK, and should not affect standalone OPA. Fixes: #7297 Signed-off-by: Johan Fylling <johan.dev@fylling.se>
This commit is contained in:
@@ -197,10 +197,11 @@ func (p *Plugin) Reconfigure(ctx context.Context, config interface{}) {
|
||||
params.Context = storage.NewContext() // TODO(sr): metrics?
|
||||
err := storage.Txn(ctx, p.manager.Store, params, func(txn storage.Transaction) error {
|
||||
opts := &bundle.DeactivateOpts{
|
||||
Ctx: ctx,
|
||||
Store: p.manager.Store,
|
||||
Txn: txn,
|
||||
BundleNames: deletedBundles,
|
||||
Ctx: ctx,
|
||||
Store: p.manager.Store,
|
||||
Txn: txn,
|
||||
BundleNames: deletedBundles,
|
||||
ParserOptions: p.manager.ParserOptions(),
|
||||
}
|
||||
err := bundle.Deactivate(opts)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user