mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-21 22:36:39 +00:00
feature: allow user to disable plugins via command-line flag
This commit is contained in:
@@ -299,7 +299,7 @@ func setupFlags(flags *flags) {
|
||||
flag.DurationVar(&flags.probe.publishInterval, "probe.publish.interval", 3*time.Second, "publish (output) interval")
|
||||
flag.DurationVar(&flags.probe.spyInterval, "probe.spy.interval", time.Second, "spy (scan) interval")
|
||||
flag.IntVar(&flags.probe.ticksPerFullReport, "probe.full-report-every", 3, "publish full report every N times, deltas in between. Make sure N < (app.window / probe.publish.interval)")
|
||||
flag.StringVar(&flags.probe.pluginsRoot, "probe.plugins.root", "/var/run/scope/plugins", "Root directory to search for plugins")
|
||||
flag.StringVar(&flags.probe.pluginsRoot, "probe.plugins.root", "/var/run/scope/plugins", "Root directory to search for plugins (disable plugins if blank)")
|
||||
flag.BoolVar(&flags.probe.noControls, "probe.no-controls", false, "Disable controls (e.g. start/stop containers, terminals, logs ...)")
|
||||
flag.BoolVar(&flags.probe.noCommandLineArguments, "probe.omit.cmd-args", false, "Disable collection of command-line arguments")
|
||||
flag.BoolVar(&flags.probe.noEnvironmentVariables, "probe.omit.env-vars", true, "Disable collection of environment variables")
|
||||
|
||||
@@ -351,21 +351,23 @@ func probeMain(flags probeFlags, targets []appclient.Target) {
|
||||
}
|
||||
}
|
||||
|
||||
pluginRegistry, err := plugins.NewRegistry(
|
||||
flags.pluginsRoot,
|
||||
pluginAPIVersion,
|
||||
map[string]string{
|
||||
"probe_id": probeID,
|
||||
"api_version": pluginAPIVersion,
|
||||
},
|
||||
handlerRegistry,
|
||||
p,
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf("plugins: problem loading: %v", err)
|
||||
} else {
|
||||
defer pluginRegistry.Close()
|
||||
p.AddReporter(pluginRegistry)
|
||||
if flags.pluginsRoot != "" {
|
||||
pluginRegistry, err := plugins.NewRegistry(
|
||||
flags.pluginsRoot,
|
||||
pluginAPIVersion,
|
||||
map[string]string{
|
||||
"probe_id": probeID,
|
||||
"api_version": pluginAPIVersion,
|
||||
},
|
||||
handlerRegistry,
|
||||
p,
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf("plugins: problem loading: %v", err)
|
||||
} else {
|
||||
defer pluginRegistry.Close()
|
||||
p.AddReporter(pluginRegistry)
|
||||
}
|
||||
}
|
||||
|
||||
maybeExportProfileData(flags)
|
||||
|
||||
Reference in New Issue
Block a user