mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-17 01:41:56 +00:00
Adding resolved prop to service map node (#959)
* Adding resolved prop to service map node * fixing tests
This commit is contained in:
parent
59ad8d8fad
commit
6a7fad430c
@ -104,12 +104,14 @@ func (s *ServiceMapControllerSuite) TestGet() {
|
|||||||
Id: 1,
|
Id: 1,
|
||||||
Name: TCPEntryA.Name,
|
Name: TCPEntryA.Name,
|
||||||
Entry: TCPEntryA,
|
Entry: TCPEntryA,
|
||||||
|
Resolved: true,
|
||||||
Count: 1,
|
Count: 1,
|
||||||
}
|
}
|
||||||
bNode := servicemap.ServiceMapNode{
|
bNode := servicemap.ServiceMapNode{
|
||||||
Id: 2,
|
Id: 2,
|
||||||
Name: TCPEntryB.Name,
|
Name: TCPEntryB.Name,
|
||||||
Entry: TCPEntryB,
|
Entry: TCPEntryB,
|
||||||
|
Resolved: true,
|
||||||
Count: 1,
|
Count: 1,
|
||||||
}
|
}
|
||||||
assert.Contains(response.Nodes, aNode)
|
assert.Contains(response.Nodes, aNode)
|
||||||
|
@ -22,6 +22,7 @@ type ServiceMapNode struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Entry *tapApi.TCP `json:"entry"`
|
Entry *tapApi.TCP `json:"entry"`
|
||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
|
Resolved bool `json:"resolved"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServiceMapEdge struct {
|
type ServiceMapEdge struct {
|
||||||
|
@ -229,6 +229,7 @@ func (s *defaultServiceMap) GetNodes() []ServiceMapNode {
|
|||||||
nodes = append(nodes, ServiceMapNode{
|
nodes = append(nodes, ServiceMapNode{
|
||||||
Id: n.id,
|
Id: n.id,
|
||||||
Name: string(i),
|
Name: string(i),
|
||||||
|
Resolved: n.entry.Name != UnresolvedNodeName,
|
||||||
Entry: n.entry,
|
Entry: n.entry,
|
||||||
Count: n.count,
|
Count: n.count,
|
||||||
})
|
})
|
||||||
@ -246,12 +247,14 @@ func (s *defaultServiceMap) GetEdges() []ServiceMapEdge {
|
|||||||
Id: s.graph.Nodes[u].id,
|
Id: s.graph.Nodes[u].id,
|
||||||
Name: string(u),
|
Name: string(u),
|
||||||
Entry: s.graph.Nodes[u].entry,
|
Entry: s.graph.Nodes[u].entry,
|
||||||
|
Resolved: s.graph.Nodes[u].entry.Name != UnresolvedNodeName,
|
||||||
Count: s.graph.Nodes[u].count,
|
Count: s.graph.Nodes[u].count,
|
||||||
},
|
},
|
||||||
Destination: ServiceMapNode{
|
Destination: ServiceMapNode{
|
||||||
Id: s.graph.Nodes[v].id,
|
Id: s.graph.Nodes[v].id,
|
||||||
Name: string(v),
|
Name: string(v),
|
||||||
Entry: s.graph.Nodes[v].entry,
|
Entry: s.graph.Nodes[v].entry,
|
||||||
|
Resolved: s.graph.Nodes[v].entry.Name != UnresolvedNodeName,
|
||||||
Count: s.graph.Nodes[v].count,
|
Count: s.graph.Nodes[v].count,
|
||||||
},
|
},
|
||||||
Count: p.count,
|
Count: p.count,
|
||||||
|
Loading…
Reference in New Issue
Block a user