mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-19 05:19:35 +00:00
Render replica set and deployment parents
This commit is contained in:
@@ -143,7 +143,7 @@ var (
|
||||
{
|
||||
topologyID: report.Service,
|
||||
NodeSummaryGroup: NodeSummaryGroup{
|
||||
TopologyID: "pods-by-service",
|
||||
TopologyID: "services",
|
||||
Label: "Services",
|
||||
Columns: []Column{
|
||||
{ID: report.Pod, Label: "# Pods"},
|
||||
|
||||
@@ -364,7 +364,7 @@ func TestMakeDetailedPodNode(t *testing.T) {
|
||||
{
|
||||
ID: fixture.ServiceNodeID,
|
||||
Label: fixture.ServiceName,
|
||||
TopologyID: "pods-by-service",
|
||||
TopologyID: "services",
|
||||
},
|
||||
},
|
||||
Connections: []detailed.ConnectionsSummary{
|
||||
|
||||
@@ -25,6 +25,8 @@ func Parents(r report.Report, n report.Node) (result []Parent) {
|
||||
}{
|
||||
report.Container: {r.Container, containerParent},
|
||||
report.Pod: {r.Pod, podParent},
|
||||
report.ReplicaSet: {r.ReplicaSet, replicaSetParent},
|
||||
report.Deployment: {r.Deployment, deploymentParent},
|
||||
report.Service: {r.Service, serviceParent},
|
||||
report.ContainerImage: {r.ContainerImage, containerImageParent},
|
||||
report.Host: {r.Host, hostParent},
|
||||
@@ -62,21 +64,21 @@ func containerParent(n report.Node) Parent {
|
||||
}
|
||||
}
|
||||
|
||||
func podParent(n report.Node) Parent {
|
||||
podName, _ := n.Latest.Lookup(kubernetes.Name)
|
||||
return Parent{
|
||||
ID: n.ID,
|
||||
Label: podName,
|
||||
TopologyID: "pods",
|
||||
}
|
||||
}
|
||||
var (
|
||||
podParent = kubernetesParent("pods")
|
||||
replicaSetParent = kubernetesParent("replica-sets")
|
||||
deploymentParent = kubernetesParent("deployments")
|
||||
serviceParent = kubernetesParent("services")
|
||||
)
|
||||
|
||||
func serviceParent(n report.Node) Parent {
|
||||
serviceName, _ := n.Latest.Lookup(kubernetes.Name)
|
||||
return Parent{
|
||||
ID: n.ID,
|
||||
Label: serviceName,
|
||||
TopologyID: "pods-by-service",
|
||||
func kubernetesParent(topology string) func(report.Node) Parent {
|
||||
return func(n report.Node) Parent {
|
||||
name, _ := n.Latest.Lookup(kubernetes.Name)
|
||||
return Parent{
|
||||
ID: n.ID,
|
||||
Label: name,
|
||||
TopologyID: topology,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user