Apply any configuration to a plugin

This commit is contained in:
Evan Phoenix 2015-04-07 11:53:30 -07:00
parent f0675e52c3
commit 81f41059f4
1 changed files with 8 additions and 1 deletions

View File

@ -78,7 +78,14 @@ func (a *Agent) LoadPlugins() ([]string, error) {
var names []string var names []string
for name, creator := range plugins.Plugins { for name, creator := range plugins.Plugins {
a.plugins = append(a.plugins, creator()) plugin := creator()
err := a.Config.Apply(name, plugin)
if err != nil {
return nil, err
}
a.plugins = append(a.plugins, plugin)
names = append(names, name) names = append(names, name)
} }