summaryrefslogtreecommitdiff
path: root/plugins/kv/boltdb/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/kv/boltdb/plugin.go')
-rw-r--r--plugins/kv/boltdb/plugin.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/kv/boltdb/plugin.go b/plugins/kv/boltdb/plugin.go
index 683d6fc5..1e3d2c34 100644
--- a/plugins/kv/boltdb/plugin.go
+++ b/plugins/kv/boltdb/plugin.go
@@ -42,15 +42,19 @@ type Plugin struct {
func (s *Plugin) Init(log logger.Logger, cfg config.Configurer) error {
const op = errors.Op("boltdb_plugin_init")
- s.cfg = &Config{}
- s.cfg.InitDefaults()
+ if !cfg.Has(PluginName) {
+ return errors.E(op, errors.Disabled)
+ }
err := cfg.UnmarshalKey(PluginName, &s.cfg)
if err != nil {
return errors.E(op, errors.Disabled, err)
}
+ // add default values
+ s.cfg.InitDefaults()
+
// set the logger
s.log = log