WIP -- deprecating host node id

It represents which probe the _thing_ was seen from, but in many cases
(container images, deployments, replicasets, services), it may have come
from several probes. We have previously conflated it to determine which
host a thing _lives on_, which it may not even have (deployments,
replica sets, services), or it may have multiple (container images).

The idea is to separate those two usages. We should convert HostNodeID
to a set of HostNodeIDs, and use that to determine which probes have
reported the thing. For determining which host a thing lives on we
should use the Parents field which we already have, but might need
extending to handle Endpoints/etc...
This commit is contained in:
Paul Bellamy
2016-05-12 15:28:25 +01:00
parent 7bae566f81
commit a9807da0bb
8 changed files with 57 additions and 42 deletions

View File

@@ -159,6 +159,11 @@ func propagateLatest(key string, from, to report.Node) report.Node {
return to
}
func propagateParents(topology string, from, to report.Node) report.Node {
p, _ := from.Parents.Lookup(topology)
return to.WithParents(report.EmptySets.Add(topology, p))
}
// Condition is a predecate over the entire report that can evaluate to true or false.
type Condition func(report.Report) bool