diff --git a/app/api_topologies.go b/app/api_topologies.go index 7ae3555426..613747cb47 100644 --- a/app/api_topologies.go +++ b/app/api_topologies.go @@ -21,6 +21,14 @@ var ( topologyRegistry = ®istry{ items: map[string]APITopologyDesc{}, } + k8sPseudoFilter = APITopologyOptionGroup{ + ID: "pseudo", + Default: "show", + Options: []APITopologyOption{ + {"show", "Show Unmanaged", nil, false}, + {"hide", "Hide Unmanaged", render.IsNotPseudo, true}, + }, + } ) func init() { @@ -29,18 +37,26 @@ func init() { ID: "system", Default: "application", Options: []APITopologyOption{ - {"system", "System containers", render.IsSystem}, - {"application", "Application containers", render.IsApplication}, - {"both", "Both", nil}, + {"system", "System containers", render.IsSystem, false}, + {"application", "Application containers", render.IsApplication, false}, + {"both", "Both", nil, false}, }, }, { ID: "stopped", Default: "running", Options: []APITopologyOption{ - {"stopped", "Stopped containers", render.IsStopped}, - {"running", "Running containers", render.IsRunning}, - {"both", "Both", nil}, + {"stopped", "Stopped containers", render.IsStopped, false}, + {"running", "Running containers", render.IsRunning, false}, + {"both", "Both", nil, false}, + }, + }, + { + ID: "pseudo", + Default: "show", + Options: []APITopologyOption{ + {"show", "Show Uncontained", nil, false}, + {"hide", "Hide Uncontained", render.IsNotPseudo, true}, }, }, } @@ -52,7 +68,7 @@ func init() { Options: []APITopologyOption{ // Show the user why there are filtered nodes in this view. // Don't give them the option to show those nodes. - {"hide", "Unconnected nodes hidden", nil}, + {"hide", "Unconnected nodes hidden", nil, false}, }, }, } @@ -142,9 +158,11 @@ func kubernetesFilters(namespaces ...string) APITopologyOptionGroup { if namespace == "default" { options.Default = namespace } - options.Options = append(options.Options, APITopologyOption{namespace, namespace, render.IsNamespace(namespace)}) + options.Options = append(options.Options, APITopologyOption{ + namespace, namespace, render.IsNamespace(namespace), false, + }) } - options.Options = append(options.Options, APITopologyOption{"all", "All Namespaces", nil}) + options.Options = append(options.Options, APITopologyOption{"all", "All Namespaces", nil, false}) return options } @@ -169,7 +187,9 @@ func updateFilters(rpt report.Report, topologies []APITopologyDesc) []APITopolog sort.Strings(ns) for i, t := range topologies { if t.id == "pods" || t.id == "services" || t.id == "deployments" || t.id == "replica-sets" { - topologies[i] = updateTopologyFilters(t, []APITopologyOptionGroup{kubernetesFilters(ns...)}) + topologies[i] = updateTopologyFilters(t, []APITopologyOptionGroup{ + kubernetesFilters(ns...), k8sPseudoFilter, + }) } } return topologies @@ -224,7 +244,8 @@ type APITopologyOption struct { Value string `json:"value"` Label string `json:"label"` - filter render.FilterFunc + filter render.FilterFunc + filterPseudo bool } type topologyStats struct { @@ -329,7 +350,7 @@ func (r *registry) rendererForTopology(topologyID string, values url.Values, rpt } topology = updateFilters(rpt, []APITopologyDesc{topology})[0] - var filters []render.FilterFunc + var decorators []render.Decorator for _, group := range topology.Options { value := values.Get(group.ID) for _, opt := range group.Options { @@ -337,17 +358,18 @@ func (r *registry) rendererForTopology(topologyID string, values url.Values, rpt continue } if (value == "" && group.Default == opt.Value) || (opt.Value != "" && opt.Value == value) { - filters = append(filters, opt.filter) + if opt.filterPseudo { + decorators = append(decorators, render.MakeFilterPseudoDecorator(opt.filter)) + } else { + decorators = append(decorators, render.MakeFilterDecorator(opt.filter)) + } } } } - var decorator render.Decorator - if len(filters) > 0 { - decorator = func(renderer render.Renderer) render.Renderer { - return render.MakeFilter(render.ComposeFilterFuncs(filters...), renderer) - } + if len(decorators) > 0 { + return topology.renderer, render.ComposeDecorators(decorators...), nil } - return topology.renderer, decorator, nil + return topology.renderer, nil, nil } type reporterHandler func(context.Context, Reporter, http.ResponseWriter, *http.Request) diff --git a/experimental/graphviz/render.go b/experimental/graphviz/render.go index 5433db826c..5c96f1ac46 100644 --- a/experimental/graphviz/render.go +++ b/experimental/graphviz/render.go @@ -19,5 +19,5 @@ func renderTo(rpt report.Report, topology string) (detailed.NodeSummaries, error if !ok { return detailed.NodeSummaries{}, fmt.Errorf("unknown topology %v", topology) } - return detailed.Summaries(rpt, renderer.Render(rpt, render.FilterNoop)), nil + return detailed.Summaries(rpt, renderer.Render(rpt, nil)), nil } diff --git a/render/benchmark_test.go b/render/benchmark_test.go index ecf00d3288..40e4c480b8 100644 --- a/render/benchmark_test.go +++ b/render/benchmark_test.go @@ -74,7 +74,7 @@ func benchmarkRender(b *testing.B, r render.Renderer) { b.StopTimer() render.ResetCache() b.StartTimer() - benchmarkRenderResult = r.Render(report, render.FilterNoop) + benchmarkRenderResult = r.Render(report, FilterNoop) if len(benchmarkRenderResult) == 0 { b.Errorf("Rendered topology contained no nodes") } @@ -94,7 +94,7 @@ func benchmarkStats(b *testing.B, r render.Renderer) { b.StopTimer() render.ResetCache() b.StartTimer() - benchmarkStatsResult = r.Stats(report, render.FilterNoop) + benchmarkStatsResult = r.Stats(report, FilterNoop) } } diff --git a/render/container.go b/render/container.go index 7515e25da2..5ec6ccbe29 100644 --- a/render/container.go +++ b/render/container.go @@ -143,6 +143,26 @@ func ShortLivedConnectionJoin(r Renderer, toIPs func(report.Node) []string) Rend )) } +// FilterEmpty is a Renderer which filters out nodes which have no children +// from the specified topology. +func FilterEmpty(topology string, r Renderer) Renderer { + return MakeFilter(HasChildren(topology), r) +} + +// HasChildren returns true if the node has no children from the specified +// topology. +func HasChildren(topology string) FilterFunc { + return func(n report.Node) bool { + count := 0 + n.Children.ForEach(func(child report.Node) { + if child.Topology == topology { + count++ + } + }) + return count > 0 + } +} + type containerWithImageNameRenderer struct { Renderer } diff --git a/render/container_test.go b/render/container_test.go index ec35de093e..97aee4bd34 100644 --- a/render/container_test.go +++ b/render/container_test.go @@ -15,6 +15,14 @@ import ( "github.com/weaveworks/scope/test/reflect" ) +// FilterApplication is a Renderer which filters out application nodes. +func FilterApplication(r render.Renderer) render.Renderer { + return render.MakeFilter(render.IsApplication, r) +} + +// FilterNoop does nothing. +func FilterNoop(r render.Renderer) render.Renderer { return r } + func TestMapProcess2Container(t *testing.T) { for _, input := range []testcase{ {"empty", report.MakeNode("empty"), true}, @@ -47,7 +55,7 @@ func testMap(t *testing.T, f render.MapFunc, input testcase) { } func TestContainerRenderer(t *testing.T) { - have := Prune(render.ContainerWithImageNameRenderer.Render(fixture.Report, render.FilterNoop)) + have := Prune(render.ContainerWithImageNameRenderer.Render(fixture.Report, FilterNoop)) want := Prune(expected.RenderedContainers) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) @@ -61,7 +69,7 @@ func TestContainerFilterRenderer(t *testing.T) { input.Container.Nodes[fixture.ClientContainerNodeID] = input.Container.Nodes[fixture.ClientContainerNodeID].WithLatests(map[string]string{ docker.LabelPrefix + "works.weave.role": "system", }) - have := Prune(render.ContainerWithImageNameRenderer.Render(input, render.FilterApplication)) + have := Prune(render.ContainerWithImageNameRenderer.Render(input, FilterApplication)) want := Prune(expected.RenderedContainers.Copy()) delete(want, fixture.ClientContainerNodeID) if !reflect.DeepEqual(want, have) { @@ -70,7 +78,7 @@ func TestContainerFilterRenderer(t *testing.T) { } func TestContainerHostnameRenderer(t *testing.T) { - have := Prune(render.ContainerHostnameRenderer.Render(fixture.Report, render.FilterNoop)) + have := Prune(render.ContainerHostnameRenderer.Render(fixture.Report, FilterNoop)) want := Prune(expected.RenderedContainerHostnames) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) @@ -93,7 +101,7 @@ func TestContainerHostnameFilterRenderer(t *testing.T) { Add("host", report.MakeStringSet(fixture.ClientHostNodeID)), ).WithTopology(report.Container)) - have := Prune(render.ContainerHostnameRenderer.Render(input, render.FilterApplication)) + have := Prune(render.ContainerHostnameRenderer.Render(input, FilterApplication)) want := Prune(expected.RenderedContainerHostnames) // Test works by virtue of the RenderedContainerHostname only having a container // counter == 1 @@ -104,7 +112,7 @@ func TestContainerHostnameFilterRenderer(t *testing.T) { } func TestContainerImageRenderer(t *testing.T) { - have := Prune(render.ContainerImageRenderer.Render(fixture.Report, render.FilterNoop)) + have := Prune(render.ContainerImageRenderer.Render(fixture.Report, FilterNoop)) want := Prune(expected.RenderedContainerImages) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) @@ -129,7 +137,7 @@ func TestContainerImageFilterRenderer(t *testing.T) { Add("host", report.MakeStringSet(fixture.ClientHostNodeID)), ).WithTopology(report.ContainerImage)) - have := Prune(render.ContainerImageRenderer.Render(input, render.FilterApplication)) + have := Prune(render.ContainerImageRenderer.Render(input, FilterApplication)) want := Prune(expected.RenderedContainerImages.Copy()) // Test works by virtue of the RenderedContainerImage only having a container // counter == 1 diff --git a/render/detailed/node_test.go b/render/detailed/node_test.go index d36c74c12d..f314a83ac5 100644 --- a/render/detailed/node_test.go +++ b/render/detailed/node_test.go @@ -18,7 +18,7 @@ import ( ) func child(t *testing.T, r render.Renderer, id string) detailed.NodeSummary { - s, ok := detailed.MakeNodeSummary(fixture.Report, r.Render(fixture.Report, render.FilterNoop)[id]) + s, ok := detailed.MakeNodeSummary(fixture.Report, r.Render(fixture.Report, nil)[id]) if !ok { t.Fatalf("Expected node %s to be summarizable, but wasn't", id) } @@ -26,7 +26,7 @@ func child(t *testing.T, r render.Renderer, id string) detailed.NodeSummary { } func TestMakeDetailedHostNode(t *testing.T) { - renderableNodes := render.HostRenderer.Render(fixture.Report, render.FilterNoop) + renderableNodes := render.HostRenderer.Render(fixture.Report, nil) renderableNode := renderableNodes[fixture.ClientHostNodeID] have := detailed.MakeNode("hosts", fixture.Report, renderableNodes, renderableNode) @@ -177,7 +177,7 @@ func TestMakeDetailedHostNode(t *testing.T) { func TestMakeDetailedContainerNode(t *testing.T) { id := fixture.ServerContainerNodeID - renderableNodes := render.ContainerWithImageNameRenderer.Render(fixture.Report, render.FilterNoop) + renderableNodes := render.ContainerWithImageNameRenderer.Render(fixture.Report, nil) renderableNode, ok := renderableNodes[id] if !ok { t.Fatalf("Node not found: %s", id) @@ -310,7 +310,7 @@ func TestMakeDetailedContainerNode(t *testing.T) { func TestMakeDetailedPodNode(t *testing.T) { id := fixture.ServerPodNodeID - renderableNodes := render.PodRenderer.Render(fixture.Report, render.FilterNoop) + renderableNodes := render.PodRenderer.Render(fixture.Report, nil) renderableNode, ok := renderableNodes[id] if !ok { t.Fatalf("Node not found: %s", id) diff --git a/render/detailed/parents_test.go b/render/detailed/parents_test.go index b5e367f898..7a265587fb 100644 --- a/render/detailed/parents_test.go +++ b/render/detailed/parents_test.go @@ -21,25 +21,25 @@ func TestParents(t *testing.T) { }{ { name: "Node accidentally tagged with itself", - node: render.HostRenderer.Render(fixture.Report, render.FilterNoop)[fixture.ClientHostNodeID].WithParents( + node: render.HostRenderer.Render(fixture.Report, nil)[fixture.ClientHostNodeID].WithParents( report.EmptySets.Add(report.Host, report.MakeStringSet(fixture.ClientHostNodeID)), ), want: nil, }, { - node: render.HostRenderer.Render(fixture.Report, render.FilterNoop)[fixture.ClientHostNodeID], + node: render.HostRenderer.Render(fixture.Report, nil)[fixture.ClientHostNodeID], want: nil, }, { name: "Container image", - node: render.ContainerImageRenderer.Render(fixture.Report, render.FilterNoop)[expected.ClientContainerImageNodeID], + node: render.ContainerImageRenderer.Render(fixture.Report, nil)[expected.ClientContainerImageNodeID], want: []detailed.Parent{ {ID: fixture.ClientHostNodeID, Label: fixture.ClientHostName, TopologyID: "hosts"}, }, }, { name: "Container", - node: render.ContainerWithImageNameRenderer.Render(fixture.Report, render.FilterNoop)[fixture.ClientContainerNodeID], + node: render.ContainerWithImageNameRenderer.Render(fixture.Report, nil)[fixture.ClientContainerNodeID], want: []detailed.Parent{ {ID: expected.ClientContainerImageNodeID, Label: fixture.ClientContainerImageName, TopologyID: "containers-by-image"}, {ID: fixture.ClientHostNodeID, Label: fixture.ClientHostName, TopologyID: "hosts"}, @@ -47,7 +47,7 @@ func TestParents(t *testing.T) { }, }, { - node: render.ProcessRenderer.Render(fixture.Report, render.FilterNoop)[fixture.ClientProcess1NodeID], + node: render.ProcessRenderer.Render(fixture.Report, nil)[fixture.ClientProcess1NodeID], want: []detailed.Parent{ {ID: fixture.ClientContainerNodeID, Label: fixture.ClientContainerName, TopologyID: "containers"}, {ID: fixture.ClientHostNodeID, Label: fixture.ClientHostName, TopologyID: "hosts"}, diff --git a/render/detailed/summary_test.go b/render/detailed/summary_test.go index c608a5718b..5fe3de9f7f 100644 --- a/render/detailed/summary_test.go +++ b/render/detailed/summary_test.go @@ -21,7 +21,7 @@ import ( func TestSummaries(t *testing.T) { { // Just a convenient source of some rendered nodes - have := detailed.Summaries(fixture.Report, render.ProcessRenderer.Render(fixture.Report, render.FilterNoop)) + have := detailed.Summaries(fixture.Report, render.ProcessRenderer.Render(fixture.Report, nil)) // The ids of the processes rendered above expectedIDs := []string{ fixture.ClientProcess1NodeID, @@ -51,7 +51,7 @@ func TestSummaries(t *testing.T) { input := fixture.Report.Copy() input.Process.Nodes[fixture.ClientProcess1NodeID] = input.Process.Nodes[fixture.ClientProcess1NodeID].WithMetrics(report.Metrics{process.CPUUsage: metric}) - have := detailed.Summaries(input, render.ProcessRenderer.Render(input, render.FilterNoop)) + have := detailed.Summaries(input, render.ProcessRenderer.Render(input, nil)) node, ok := have[fixture.ClientProcess1NodeID] if !ok { diff --git a/render/filters.go b/render/filters.go index 7addf13d94..4319db87d2 100644 --- a/render/filters.go +++ b/render/filters.go @@ -76,14 +76,40 @@ type Filter struct { FilterFunc FilterFunc } -// MakeFilter makes a new Filter. +// MakeFilter makes a new Filter (that ignores pseudo nodes). func MakeFilter(f FilterFunc, r Renderer) Renderer { + return Memoise(&Filter{ + Renderer: r, + FilterFunc: func(n report.Node) bool { + return n.Topology == Pseudo || f(n) + }, + }) +} + +// MakeFilterPseudo makes a new Filter that will not ignore pseudo nodes. +func MakeFilterPseudo(f FilterFunc, r Renderer) Renderer { return Memoise(&Filter{ Renderer: r, FilterFunc: f, }) } +// MakeFilterDecorator makes a decorator that filters out non-pseudo nodes +// which match the predicate. +func MakeFilterDecorator(f FilterFunc) Decorator { + return func(renderer Renderer) Renderer { + return MakeFilter(f, renderer) + } +} + +// MakeFilterPseudoDecorator makes a decorator that filters out all nodes +// (including pseudo nodes) which match the predicate. +func MakeFilterPseudoDecorator(f FilterFunc) Decorator { + return func(renderer Renderer) Renderer { + return MakeFilterPseudo(f, renderer) + } +} + // Render implements Renderer func (f *Filter) Render(rpt report.Report, dct Decorator) report.Nodes { nodes, _ := f.render(rpt, dct) @@ -95,7 +121,7 @@ func (f *Filter) render(rpt report.Report, dct Decorator) (report.Nodes, int) { inDegrees := map[string]int{} filtered := 0 for id, node := range f.Renderer.Render(rpt, dct) { - if node.Topology == Pseudo || f.FilterFunc(node) { + if f.FilterFunc(node) { output[id] = node inDegrees[id] = 0 } else { @@ -165,9 +191,6 @@ func FilterUnconnected(r Renderer) Renderer { // Noop allows all nodes through func Noop(_ report.Node) bool { return true } -// FilterNoop does nothing. -func FilterNoop(r Renderer) Renderer { return r } - // IsRunning checks if the node is a running docker container func IsRunning(n report.Node) bool { state, ok := n.Latest.Lookup(docker.ContainerState) @@ -177,16 +200,6 @@ func IsRunning(n report.Node) bool { // IsStopped checks if the node is *not* a running docker container var IsStopped = Complement(IsRunning) -// FilterStopped filters out stopped containers. -func FilterStopped(r Renderer) Renderer { - return MakeFilter(IsStopped, r) -} - -// FilterRunning filters out running containers. -func FilterRunning(r Renderer) Renderer { - return MakeFilter(IsRunning, r) -} - // FilterNonProcspied removes endpoints which were not found in procspy. func FilterNonProcspied(r Renderer) Renderer { return MakeFilter( @@ -231,34 +244,10 @@ func IsApplication(n report.Node) bool { // IsSystem checks if the node is a "system" node var IsSystem = Complement(IsApplication) -// FilterSystem is a Renderer which filters out system nodes. -func FilterSystem(r Renderer) Renderer { - return MakeFilter(IsSystem, r) -} - -// FilterApplication is a Renderer which filters out application nodes. -func FilterApplication(r Renderer) Renderer { - return MakeFilter(IsApplication, r) -} - -// FilterEmpty is a Renderer which filters out nodes which have no children -// from the specified topology. -func FilterEmpty(topology string, r Renderer) Renderer { - return MakeFilter(HasChildren(topology), r) -} - -// HasChildren returns true if the node has no children from the specified -// topology. -func HasChildren(topology string) FilterFunc { - return func(n report.Node) bool { - count := 0 - n.Children.ForEach(func(child report.Node) { - if child.Topology == topology { - count++ - } - }) - return count > 0 - } +// IsNotPseudo returns true if the node is not a pseudo node +// or the internet nodes. +func IsNotPseudo(n report.Node) bool { + return n.Topology != Pseudo || strings.HasSuffix(n.ID, TheInternetID) } // IsNamespace checks if the node is a pod/service in the specified namespace diff --git a/render/host.go b/render/host.go index f56c280354..19b4cf3b0e 100644 --- a/render/host.go +++ b/render/host.go @@ -6,7 +6,7 @@ import ( // HostRenderer is a Renderer which produces a renderable host // graph from the host topology. -var HostRenderer = MakeReduce( +var HostRenderer = ApplyDecorators(MakeReduce( MakeMap( MapEndpoint2Host, EndpointRenderer, @@ -28,7 +28,7 @@ var HostRenderer = MakeReduce( PodRenderer, ), SelectHost, -) +)) // MapX2Host maps any Nodes to host Nodes. // diff --git a/render/host_test.go b/render/host_test.go index 26c77f159d..2cd1dd8317 100644 --- a/render/host_test.go +++ b/render/host_test.go @@ -11,7 +11,7 @@ import ( ) func TestHostRenderer(t *testing.T) { - have := Prune(render.HostRenderer.Render(fixture.Report, render.FilterNoop)) + have := Prune(render.HostRenderer.Render(fixture.Report, FilterNoop)) want := Prune(expected.RenderedHosts) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) diff --git a/render/process.go b/render/process.go index 10e5ae9db7..0d624807df 100644 --- a/render/process.go +++ b/render/process.go @@ -33,13 +33,13 @@ var EndpointRenderer = FilterNonProcspied(SelectEndpoint) // ProcessRenderer is a Renderer which produces a renderable process // graph by merging the endpoint graph and the process topology. var ProcessRenderer = ConditionalRenderer(renderProcesses, - ColorConnected(MakeReduce( + ApplyDecorators(ColorConnected(MakeReduce( MakeMap( MapEndpoint2Process, EndpointRenderer, ), SelectProcess, - )), + ))), ) // processWithContainerNameRenderer is a Renderer which produces a process diff --git a/render/process_test.go b/render/process_test.go index fd5b75481a..3c76cb0c12 100644 --- a/render/process_test.go +++ b/render/process_test.go @@ -11,7 +11,7 @@ import ( ) func TestEndpointRenderer(t *testing.T) { - have := Prune(render.EndpointRenderer.Render(fixture.Report, render.FilterNoop)) + have := Prune(render.EndpointRenderer.Render(fixture.Report, FilterNoop)) want := Prune(expected.RenderedEndpoints) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) @@ -19,7 +19,7 @@ func TestEndpointRenderer(t *testing.T) { } func TestProcessRenderer(t *testing.T) { - have := Prune(render.ProcessRenderer.Render(fixture.Report, render.FilterNoop)) + have := Prune(render.ProcessRenderer.Render(fixture.Report, FilterNoop)) want := Prune(expected.RenderedProcesses) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) @@ -27,7 +27,7 @@ func TestProcessRenderer(t *testing.T) { } func TestProcessNameRenderer(t *testing.T) { - have := Prune(render.ProcessNameRenderer.Render(fixture.Report, render.FilterNoop)) + have := Prune(render.ProcessNameRenderer.Render(fixture.Report, FilterNoop)) want := Prune(expected.RenderedProcessNames) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) diff --git a/render/render_test.go b/render/render_test.go index 3763299e3f..5164a290d4 100644 --- a/render/render_test.go +++ b/render/render_test.go @@ -56,7 +56,7 @@ func TestReduceRender(t *testing.T) { "foo": report.MakeNode("foo"), "bar": report.MakeNode("bar"), } - have := renderer.Render(report.MakeReport(), render.FilterNoop) + have := renderer.Render(report.MakeReport(), FilterNoop) if !reflect.DeepEqual(want, have) { t.Errorf("want %+v, have %+v", want, have) } @@ -73,7 +73,7 @@ func TestMapRender1(t *testing.T) { }}, } want := report.Nodes{} - have := mapper.Render(report.MakeReport(), render.FilterNoop) + have := mapper.Render(report.MakeReport(), FilterNoop) if !reflect.DeepEqual(want, have) { t.Errorf("want %+v, have %+v", want, have) } @@ -95,7 +95,7 @@ func TestMapRender2(t *testing.T) { want := report.Nodes{ "bar": report.MakeNode("bar"), } - have := mapper.Render(report.MakeReport(), render.FilterNoop) + have := mapper.Render(report.MakeReport(), FilterNoop) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) } @@ -117,7 +117,7 @@ func TestMapRender3(t *testing.T) { "_foo": report.MakeNode("_foo").WithAdjacent("_baz"), "_baz": report.MakeNode("_baz").WithAdjacent("_foo"), } - have := mapper.Render(report.MakeReport(), render.FilterNoop) + have := mapper.Render(report.MakeReport(), FilterNoop) if !reflect.DeepEqual(want, have) { t.Error(test.Diff(want, have)) } diff --git a/render/short_lived_connections_test.go b/render/short_lived_connections_test.go index be3196c453..49d864ae9c 100644 --- a/render/short_lived_connections_test.go +++ b/render/short_lived_connections_test.go @@ -125,7 +125,7 @@ var ( ) func TestShortLivedInternetNodeConnections(t *testing.T) { - have := Prune(render.ContainerWithImageNameRenderer.Render(rpt, render.FilterNoop)) + have := Prune(render.ContainerWithImageNameRenderer.Render(rpt, FilterNoop)) // Conntracked-only connections from the internet should be assigned to the internet pseudonode internet, ok := have[render.IncomingInternetID] @@ -139,7 +139,7 @@ func TestShortLivedInternetNodeConnections(t *testing.T) { } func TestPauseContainerDiscarded(t *testing.T) { - have := Prune(render.ContainerWithImageNameRenderer.Render(rpt, render.FilterNoop)) + have := Prune(render.ContainerWithImageNameRenderer.Render(rpt, FilterNoop)) // There should only be a connection from container1 and the destination should be container2 container1, ok := have[container1NodeID] if !ok {