fix bug: handle short-lived ebpf-tracked connections again

This got broken in #2559.

The problem here is similar to #2551.
This commit is contained in:
Matthias Radestock
2017-06-04 18:42:54 +01:00
parent f574162f64
commit 6eaffb44e0
2 changed files with 10 additions and 5 deletions

View File

@@ -44,10 +44,10 @@ var ContainerRenderer = MakeFilter(
var mapEndpoint2IP = MakeMap(
endpoint2IP,
// We drop endpoint nodes which were procspied or eBBF-tracked, as
// they will be joined to containers through the process topology,
// and we don't want to double count edges.
MakeFilter(Complement(procspiedOrEBPF), SelectEndpoint),
// We drop endpoint nodes which were procspied, as they will be
// joined to containers through the process topology, and we don't
// want to double count edges.
MakeFilter(Complement(procspied), SelectEndpoint),
)
const originalNodeID = "original_node_id"

View File

@@ -237,8 +237,13 @@ func IsRunning(n report.Node) bool {
// IsStopped checks if the node is *not* a running docker container
var IsStopped = Complement(IsRunning)
func procspied(node report.Node) bool {
_, ok := node.Latest.Lookup(endpoint.Procspied)
return ok
}
func procspiedOrEBPF(node report.Node) bool {
if _, ok := node.Latest.Lookup(endpoint.Procspied); ok {
if procspied(node) {
return true
}
_, ok := node.Latest.Lookup(endpoint.EBPF)