mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Review feedback
This commit is contained in:
@@ -244,3 +244,8 @@ func (c *container) GetNodeMetadata() report.NodeMetadata {
|
||||
}))
|
||||
return result
|
||||
}
|
||||
|
||||
// ExtractContainerIPs returns the list of container IPs given a NodeMetadata from the Container topology.
|
||||
func ExtractContainerIPs(nmd report.NodeMetadata) []string {
|
||||
return strings.Fields(nmd.Metadata[ContainerIPs])
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ func (w Weave) tagContainer(r report.Report, containerIDPrefix, macAddress strin
|
||||
continue
|
||||
}
|
||||
|
||||
existingIPs := report.MakeIDList(strings.Fields(nmd.Metadata[docker.ContainerIPs])...)
|
||||
existingIPs := report.MakeIDList(docker.ExtractContainerIPs(nmd)...)
|
||||
existingIPs = existingIPs.Add(ips...)
|
||||
nmd.Metadata[docker.ContainerIPs] = strings.Join(existingIPs, " ")
|
||||
nmd.Metadata[WeaveMACAddress] = macAddress
|
||||
|
||||
@@ -301,7 +301,6 @@ func containerOriginTable(nmd report.NodeMetadata, addHostTag bool) (Table, bool
|
||||
{docker.ContainerPorts, "Ports"},
|
||||
{docker.ContainerCreated, "Created"},
|
||||
{docker.ContainerCommand, "Command"},
|
||||
{docker.ContainerIPs, "IP Addresses"},
|
||||
{overlay.WeaveMACAddress, "Weave MAC"},
|
||||
{overlay.WeaveDNSHostname, "Weave DNS Hostname"},
|
||||
} {
|
||||
@@ -310,6 +309,10 @@ func containerOriginTable(nmd report.NodeMetadata, addHostTag bool) (Table, bool
|
||||
}
|
||||
}
|
||||
|
||||
for _, ip := range docker.ExtractContainerIPs(nmd) {
|
||||
rows = append(rows, Row{Key: "IP Address", ValueMajor: ip, ValueMinor: ""})
|
||||
}
|
||||
|
||||
if val, ok := nmd.Metadata[docker.MemoryUsage]; ok {
|
||||
memory, err := strconv.ParseFloat(val, 64)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user