Skip to content

Commit bba9f5e

Browse files
committed
Fixup gonum.org/v1/gonum/graph API calls
1 parent 2703007 commit bba9f5e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pkg/controller/garbagecollector/dump.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (h *debugHTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
268268
graph = h.controller.dependencyGraphBuilder.uidToNode.ToGonumGraph()
269269
}
270270

271-
data, err := dot.Marshal(graph, "full", "", " ", false)
271+
data, err := dot.Marshal(graph, "full", "", " ")
272272
if err != nil {
273273
http.Error(w, err.Error(), http.StatusInternalServerError)
274274
return

pkg/controller/garbagecollector/dump_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ func TestToGonumGraphObj(t *testing.T) {
439439
func compareGraphs(expected, actual graph.Directed, t *testing.T) {
440440
// sort the edges by from ID, then to ID
441441
// (the slices we get back are from map iteration, where order is not guaranteed)
442-
expectedNodes := expected.Nodes()
443-
actualNodes := actual.Nodes()
442+
expectedNodes := expected.Nodes().(graph.NodeSlicer).NodeSlice()
443+
actualNodes := actual.Nodes().(graph.NodeSlicer).NodeSlice()
444444
sort.Sort(gonumByUID(expectedNodes))
445445
sort.Sort(gonumByUID(actualNodes))
446446

@@ -455,8 +455,8 @@ func compareGraphs(expected, actual graph.Directed, t *testing.T) {
455455
t.Errorf("expected %v, got %v", spew.Sdump(currExpected), spew.Sdump(currActual))
456456
}
457457

458-
expectedFrom := append([]graph.Node{}, expected.From(expectedNodes[i].ID())...)
459-
actualFrom := append([]graph.Node{}, actual.From(actualNodes[i].ID())...)
458+
expectedFrom := append([]graph.Node{}, expected.From(expectedNodes[i].ID()).(graph.NodeSlicer).NodeSlice()...)
459+
actualFrom := append([]graph.Node{}, actual.From(actualNodes[i].ID()).(graph.NodeSlicer).NodeSlice()...)
460460
sort.Sort(gonumByUID(expectedFrom))
461461
sort.Sort(gonumByUID(actualFrom))
462462
if len(expectedFrom) != len(actualFrom) {

0 commit comments

Comments
 (0)