mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Add Weave peers view
This commit is contained in:
@@ -29,9 +29,9 @@ func (t Tagger) Tag(r report.Report) (report.Report, error) {
|
||||
parents = report.EmptySets.Add(report.Host, report.MakeStringSet(t.hostNodeID))
|
||||
)
|
||||
|
||||
// Explicitly don't tag Endpoints and Addresses - These topologies include pseudo nodes,
|
||||
// and as such do their own host tagging
|
||||
for _, topology := range []report.Topology{r.Process, r.Container, r.ContainerImage, r.Host, r.Overlay, r.Pod} {
|
||||
// Explicitly don't tag Endpoints, Addresses and Overlay nodes - These topologies include pseudo nodes,
|
||||
// and as such do their own host tagging.
|
||||
for _, topology := range []report.Topology{r.Process, r.Container, r.ContainerImage, r.Host, r.Pod} {
|
||||
for _, node := range topology.Nodes {
|
||||
topology.AddNode(node.WithLatests(metadata).WithParents(parents))
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/weaveworks/scope/common/backoff"
|
||||
"github.com/weaveworks/scope/common/mtime"
|
||||
"github.com/weaveworks/scope/common/weave"
|
||||
"github.com/weaveworks/scope/probe/docker"
|
||||
"github.com/weaveworks/scope/probe/host"
|
||||
@@ -163,11 +164,20 @@ func (w *Weave) Report() (report.Report, error) {
|
||||
WeaveDNSHostname: {ID: WeaveDNSHostname, Label: "Weave DNS Name", From: report.FromLatest, Priority: 18},
|
||||
})
|
||||
for _, peer := range w.statusCache.Router.Peers {
|
||||
r.Overlay.AddNode(report.MakeNodeWith(report.MakeOverlayNodeID(peer.Name), map[string]string{
|
||||
node := report.MakeNodeWith(report.MakeOverlayNodeID(peer.Name), map[string]string{
|
||||
WeavePeerName: peer.Name,
|
||||
WeavePeerNickName: peer.NickName,
|
||||
}))
|
||||
|
||||
})
|
||||
if peer.Name == w.statusCache.Router.Name {
|
||||
node = node.WithLatest(report.HostNodeID, mtime.Now(), w.hostID)
|
||||
node = node.WithParents(report.EmptySets.Add(report.Host, report.MakeStringSet(w.hostID)))
|
||||
}
|
||||
for _, conn := range peer.Connections {
|
||||
if conn.Outbound {
|
||||
node = node.WithAdjacent(report.MakeOverlayNodeID(conn.Name))
|
||||
}
|
||||
}
|
||||
r.Overlay.AddNode(node)
|
||||
}
|
||||
if w.statusCache.IPAM.DefaultSubnet != "" {
|
||||
r.Overlay.AddNode(
|
||||
|
||||
Reference in New Issue
Block a user