mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Review feedback
This commit is contained in:
@@ -224,12 +224,11 @@ 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 := append(c.container.NetworkSettings.SecondaryIPAddresses, c.container.NetworkSettings.IPAddress)
|
||||
// Treat all Docker IPs as local scoped.
|
||||
ipsWithScopes := []string{}
|
||||
for _, ip := range ips {
|
||||
ipsWithScopes = append(ipsWithScopes, fmt.Sprintf("%s:%s", hostID, ip))
|
||||
ipsWithScopes = append(ipsWithScopes, report.MakeScopedAddressNodeID(hostID, ip))
|
||||
}
|
||||
|
||||
result := report.MakeNodeWith(map[string]string{
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestContainer(t *testing.T) {
|
||||
"docker_container_created": "01 Jan 01 00:00 UTC",
|
||||
"docker_container_id": "ping",
|
||||
"docker_container_ips": "1.2.3.4",
|
||||
"docker_container_ips_with_scopes": "scope:1.2.3.4",
|
||||
"docker_container_ips_with_scopes": "scope;1.2.3.4",
|
||||
"docker_container_name": "pong",
|
||||
"docker_container_ports": "1.2.3.4:80->80/tcp, 81/tcp",
|
||||
"docker_image_id": "baz",
|
||||
|
||||
Reference in New Issue
Block a user