fixup: remove timestamp argument from node.WithLatest()

This commit is contained in:
Bryan Boreham
2019-10-19 14:03:40 +00:00
parent 07287c6ac0
commit 8be6ca5e1e
10 changed files with 20 additions and 34 deletions

View File

@@ -4,7 +4,6 @@ import (
"context"
"strings"
"github.com/weaveworks/common/mtime"
"github.com/weaveworks/scope/report"
)
@@ -189,7 +188,7 @@ func ColorConnected(r Renderer) Renderer {
RenderFunc: func(input Nodes) Nodes {
output := input.Copy()
for id := range connected(input.Nodes) {
output[id] = output[id].WithLatest(IsConnectedMark, mtime.Now(), "true")
output[id] = output[id].WithLatest(IsConnectedMark, "true")
}
return Nodes{Nodes: output, Filtered: input.Filtered}
},

View File

@@ -3,7 +3,6 @@ package render_test
import (
"context"
"testing"
"time"
"github.com/weaveworks/common/test"
"github.com/weaveworks/scope/render"
@@ -12,7 +11,6 @@ import (
)
func TestPropagateSingleMetrics(t *testing.T) {
now := time.Now()
for _, c := range []struct {
name string
input report.Node
@@ -131,7 +129,7 @@ func TestPropagateSingleMetrics(t *testing.T) {
"metric1": report.MakeMetric(nil),
}),
report.MakeNode("child2").
WithLatest(report.DoesNotMakeConnections, now, "").
WithLatest(report.DoesNotMakeConnections, "").
WithTopology(report.Container).
WithMetrics(report.Metrics{
"metric2": report.MakeMetric(nil),
@@ -150,7 +148,7 @@ func TestPropagateSingleMetrics(t *testing.T) {
"metric1": report.MakeMetric(nil),
}),
report.MakeNode("child2").
WithLatest(report.DoesNotMakeConnections, now, "").
WithLatest(report.DoesNotMakeConnections, "").
WithTopology(report.Container).
WithMetrics(report.Metrics{
"metric2": report.MakeMetric(nil),

View File

@@ -5,8 +5,6 @@ import (
"fmt"
"testing"
"github.com/weaveworks/common/mtime"
"github.com/weaveworks/scope/render"
"github.com/weaveworks/scope/report"
"github.com/weaveworks/scope/test/utils"
@@ -91,7 +89,7 @@ var (
WithSets(report.MakeSets().
Add(report.DockerContainerIPs, report.MakeStringSet(pauseContainerIP)).
Add(report.DockerContainerIPsWithScopes, report.MakeStringSet(report.MakeAddressNodeID("", pauseContainerIP))),
).WithTopology(report.Container).WithLatest(report.DoesNotMakeConnections, mtime.Now(), ""),
).WithTopology(report.Container).WithLatest(report.DoesNotMakeConnections, ""),
},
},
Host: report.Topology{