Apply any configuration to a plugin
This commit is contained in:
9
agent.go
9
agent.go
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user