Check if dockerBridge is nonblank before using it

This gives us the option of disabling the function
This commit is contained in:
Bryan Boreham
2018-07-20 22:10:49 +00:00
parent 88049b0817
commit 38ea862bfd

View File

@@ -233,7 +233,7 @@ func probeMain(flags probeFlags, targets []appclient.Target) {
if flags.dockerEnabled {
// Don't add the bridge in Kubernetes since container IPs are global and
// shouldn't be scoped
if !flags.kubernetesEnabled {
if flags.dockerBridge != "" && !flags.kubernetesEnabled {
if err := report.AddLocalBridge(flags.dockerBridge); err != nil {
log.Errorf("Docker: problem with bridge %s: %v", flags.dockerBridge, err)
}