File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -158,8 +158,15 @@ func (p *Plugin) Reconfigure(ctx context.Context, config any) {
158158 // Look for any bundles that have had their config changed, are new, or have been removed
159159 newConfig := config .(* Config )
160160 newBundles , updatedBundles , deletedBundles := p .configDelta (newConfig )
161- p .config = * newConfig
162161
162+ err := newConfig .ValidateAndInjectDefaults ()
163+ if err != nil {
164+ p .manager .Logger ().Error ("Failed to validate bundle configuration: %s" , err )
165+ p .cfgMtx .Unlock ()
166+ return
167+ }
168+
169+ p .config = * newConfig
163170 p .cfgMtx .Unlock ()
164171
165172 if len (updatedBundles ) == 0 && len (newBundles ) == 0 && len (deletedBundles ) == 0 {
@@ -194,7 +201,7 @@ func (p *Plugin) Reconfigure(ctx context.Context, config any) {
194201 // Deactivate the bundles that were removed
195202 params := storage .WriteParams
196203 params .Context = storage .NewContext () // TODO(sr): metrics?
197- err : = storage .Txn (ctx , p .manager .Store , params , func (txn storage.Transaction ) error {
204+ err = storage .Txn (ctx , p .manager .Store , params , func (txn storage.Transaction ) error {
198205 opts := & bundle.DeactivateOpts {
199206 Ctx : ctx ,
200207 Store : p .manager .Store ,
You can’t perform that action at this time.
0 commit comments