mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-21 16:42:59 +00:00
fix: merging active controls on host
Need to do the special-case merge before `n.Latest.Merge()`, otherwise it picks just one set of controls. Also modified the test to call `Merge()` where the problem happened.
This commit is contained in:
@@ -218,6 +218,12 @@ func (n Node) Merge(other Node) Node {
|
||||
panic("Cannot merge nodes with different topology types: " + topology + " != " + other.Topology)
|
||||
}
|
||||
|
||||
// Special case to merge controls from two different probes.
|
||||
// Do this first, then the value we want will be picked as newest by n.Latest.Merge().
|
||||
if topology == Host {
|
||||
n = n.MergeActiveControls(other)
|
||||
}
|
||||
|
||||
newNode := Node{
|
||||
ID: id,
|
||||
Topology: topology,
|
||||
@@ -229,11 +235,6 @@ func (n Node) Merge(other Node) Node {
|
||||
Children: n.Children.Merge(other.Children),
|
||||
}
|
||||
|
||||
// Special case to merge controls from two different probes.
|
||||
if topology == Host {
|
||||
newNode = newNode.MergeActiveControls(other)
|
||||
}
|
||||
|
||||
return newNode
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user