Commit Graph

14 Commits

Author SHA1 Message Date
Tom Wilkie
8b424df2be Review feedback. 2015-09-16 09:29:42 +00:00
Tom Wilkie
57f7b4f2e6 Rename NodeMetadata -> Node 2015-09-03 16:18:54 +00:00
Tom Wilkie
9ba38d71cc Review feedback 2015-09-03 10:19:27 +00:00
Tom Wilkie
21675f3000 Remove LeafMap - have a generic function which converts a Topology to a RenderableNodes. 2015-09-02 15:03:57 +00:00
Tom Wilkie
0217351bb7 Add tests to catch bad pseudo node mapping. 2015-09-02 13:37:03 +00:00
Tom Wilkie
1f6b3d4a45 Move Adjacency info inside the NodeMetadata struct; move pseudo node generation to the probes. 2015-08-28 15:20:27 +00:00
Tom Wilkie
e4970f9214 Give mapping functions the ability to return multiple nodes. 2015-08-27 16:29:32 +00:00
Peter Bourgon
b3868c58d7 Fix a subtle bug in render mapping
During rendering, RenderableNodes are created by Map funcs, which take only
NodeMetadata. Previously, it was simply assumed that the relevant keys for a
given Map func would be present in the metadata. If that implicit invariant
failed, the returned RenderableNode would be invalid, with e.g. an ID of
"hostid::". That, in turn, would trigger undefined behavior later on in the
rendering workflow.

This bug was detected by creating a partial node metadata for a non-local
endpoint node. That node was detected during the first phase of rendering, and
given an invalid renderable node ID of "myhostname::", which prevented it from
attaching to TheInternet pseudonode. It eventually got removed from the  set
of valid nodes, which meant nodes that were adjacent to it suddenly became
orphans, and got filtered out by the FilterUnconnected step of the rendering
pipeline.

With this change, every map func checks for the presence of mandatory fields,
i.e. the fields that compose the resulting renderable node's ID.

Also,

- Add unit tests for LeafMapFuncs
- Topology Validate checks NodeMetadatas must not have nil Metadata
2015-08-03 10:43:07 +02:00
Tom Wilkie
49dae07cca Make render module produce The Internet pseudo node. 2015-06-19 11:09:52 +00:00
Tom Wilkie
3de721bb16 Make topologies_test.go pass. 2015-06-17 17:23:24 +00:00
Tom Wilkie
16e2ccd2be Produce the container topology by way of the process topology. 2015-06-17 17:23:20 +00:00
Tom Wilkie
a759db8931 Rename Map -> LeafMap, introduce Map (with tests) 2015-06-17 17:23:19 +00:00
Tom Wilkie
2a4a33f30a Move RenderableNode and DetailedNode into render/ 2015-06-16 15:37:08 +00:00
Tom Wilkie
ae9ea5c97f Move mapping functions and main render function in render package. 2015-06-16 14:23:56 +00:00