render sensible labels for host nodes with little/no metadata

The node id, which we always have, actually contains the hostname.
This commit is contained in:
Matthias Radestock
2017-12-21 18:01:28 +00:00
parent b83f7e8ce6
commit f192e79346

View File

@@ -6,7 +6,6 @@ import (
"github.com/weaveworks/scope/probe/awsecs"
"github.com/weaveworks/scope/probe/docker"
"github.com/weaveworks/scope/probe/host"
"github.com/weaveworks/scope/probe/kubernetes"
"github.com/weaveworks/scope/probe/overlay"
"github.com/weaveworks/scope/probe/process"
@@ -319,7 +318,7 @@ func swarmServiceNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool
func hostNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool) {
var (
hostname, _ = n.Latest.Lookup(host.HostName)
hostname, _ = report.ParseHostNodeID(n.ID)
parts = strings.SplitN(hostname, ".", 2)
)