Don't scope docker IPs in Kubernetes

This commit is contained in:
Alfonso Acosta
2016-05-04 13:51:51 +00:00
parent b1836acb62
commit 4140d288a8
2 changed files with 7 additions and 3 deletions

View File

@@ -298,7 +298,7 @@ func (c *container) NetworkMode() (string, bool) {
func addScopeToIPs(hostID string, ips []string) []string {
ipsWithScopes := []string{}
for _, ip := range ips {
ipsWithScopes = append(ipsWithScopes, report.MakeScopedAddressNodeID(hostID, ip))
ipsWithScopes = append(ipsWithScopes, report.MakeAddressNodeID(hostID, ip))
}
return ipsWithScopes
}

View File

@@ -134,8 +134,12 @@ func probeMain(flags probeFlags) {
p.AddTagger(probe.NewTopologyTagger(), host.NewTagger(hostID))
if flags.dockerEnabled {
if err := report.AddLocalBridge(flags.dockerBridge); err != nil {
log.Errorf("Docker: problem with bridge %s: %v", flags.dockerBridge, err)
// Don't add the bridge in Kubernetes since container IPs are global and
// shouldn't be scoped
if !flags.kubernetesEnabled {
if err := report.AddLocalBridge(flags.dockerBridge); err != nil {
log.Errorf("Docker: problem with bridge %s: %v", flags.dockerBridge, err)
}
}
if registry, err := docker.NewRegistry(flags.dockerInterval, clients, true, hostID); err == nil {
defer registry.Stop()