Merge pull request #1283 from weaveworks/1282-plugin-panic

Don't add plugin registry if creating it fails
This commit is contained in:
Paul Bellamy
2016-04-13 11:06:42 +01:00

View File

@@ -115,19 +115,6 @@ func probeMain() {
log.Infof("probe starting, version %s, ID %s", version, probeID)
go check()
pluginRegistry, err := plugins.NewRegistry(
*pluginsRoot,
pluginAPIVersion,
map[string]string{
"probe_id": probeID,
"api_version": pluginAPIVersion,
},
)
if err != nil {
log.Errorf("plugins: problem loading: %v", err)
}
defer pluginRegistry.Close()
if len(flag.Args()) > 0 {
targets = flag.Args()
}
@@ -206,7 +193,20 @@ func probeMain() {
}
}
p.AddReporter(pluginRegistry)
pluginRegistry, err := plugins.NewRegistry(
*pluginsRoot,
pluginAPIVersion,
map[string]string{
"probe_id": probeID,
"api_version": pluginAPIVersion,
},
)
if err != nil {
log.Errorf("plugins: problem loading: %v", err)
} else {
defer pluginRegistry.Close()
p.AddReporter(pluginRegistry)
}
if *httpListen != "" {
go func() {