From d427e384797d96e97b5bee0b2dae5c28095bfb87 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Fri, 12 Feb 2016 16:38:51 +0000 Subject: [PATCH] don't show blank ips metadata row for containers with no IP --- probe/docker/container.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/probe/docker/container.go b/probe/docker/container.go index b5e89f8f8e..0f73773876 100644 --- a/probe/docker/container.go +++ b/probe/docker/container.go @@ -318,7 +318,10 @@ func (c *container) GetNode(hostID string, localAddrs []net.IP) report.Node { c.RLock() defer c.RUnlock() - ips := append(c.container.NetworkSettings.SecondaryIPAddresses, c.container.NetworkSettings.IPAddress) + ips := c.container.NetworkSettings.SecondaryIPAddresses + if c.container.NetworkSettings.IPAddress != "" { + ips = append(ips, c.container.NetworkSettings.IPAddress) + } // Treat all Docker IPs as local scoped. ipsWithScopes := []string{} for _, ip := range ips {