From e1afe22a22692a5b1357f7828d1754f8dab5c6c2 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 15 Jun 2016 21:22:29 +0000 Subject: [PATCH] Add all docker subnets to overlay topology --- probe/docker/reporter.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/probe/docker/reporter.go b/probe/docker/reporter.go index 135210f4c8..55bdbb082e 100644 --- a/probe/docker/reporter.go +++ b/probe/docker/reporter.go @@ -245,17 +245,18 @@ func (r *Reporter) containerImageTopology() report.Topology { } func (r *Reporter) overlayTopology() report.Topology { - localSubnets := []string{} + subnets := []string{} r.registry.WalkNetworks(func(network docker_client.Network) { - if network.Scope == "local" { - for _, config := range network.IPAM.Config { - localSubnets = append(localSubnets, config.Subnet) - } + for _, config := range network.IPAM.Config { + subnets = append(subnets, config.Subnet) } + }) peerID := OverlayPeerPrefix + r.hostID + // Add both local and global networks to the LocalNetworks Set + // since we treat container IPs as local node := report.MakeNode(report.MakeOverlayNodeID(peerID)).WithSets( - report.MakeSets().Add(host.LocalNetworks, report.MakeStringSet(localSubnets...))) + report.MakeSets().Add(host.LocalNetworks, report.MakeStringSet(subnets...))) return report.MakeTopology().AddNode(node) }