mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Fixup gonum.org/v1/gonum/graph API calls
This commit is contained in:
parent
27030079f3
commit
bba9f5e673
@ -268,7 +268,7 @@ func (h *debugHTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
graph = h.controller.dependencyGraphBuilder.uidToNode.ToGonumGraph()
|
||||
}
|
||||
|
||||
data, err := dot.Marshal(graph, "full", "", " ", false)
|
||||
data, err := dot.Marshal(graph, "full", "", " ")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
@ -439,8 +439,8 @@ func TestToGonumGraphObj(t *testing.T) {
|
||||
func compareGraphs(expected, actual graph.Directed, t *testing.T) {
|
||||
// sort the edges by from ID, then to ID
|
||||
// (the slices we get back are from map iteration, where order is not guaranteed)
|
||||
expectedNodes := expected.Nodes()
|
||||
actualNodes := actual.Nodes()
|
||||
expectedNodes := expected.Nodes().(graph.NodeSlicer).NodeSlice()
|
||||
actualNodes := actual.Nodes().(graph.NodeSlicer).NodeSlice()
|
||||
sort.Sort(gonumByUID(expectedNodes))
|
||||
sort.Sort(gonumByUID(actualNodes))
|
||||
|
||||
@ -455,8 +455,8 @@ func compareGraphs(expected, actual graph.Directed, t *testing.T) {
|
||||
t.Errorf("expected %v, got %v", spew.Sdump(currExpected), spew.Sdump(currActual))
|
||||
}
|
||||
|
||||
expectedFrom := append([]graph.Node{}, expected.From(expectedNodes[i].ID())...)
|
||||
actualFrom := append([]graph.Node{}, actual.From(actualNodes[i].ID())...)
|
||||
expectedFrom := append([]graph.Node{}, expected.From(expectedNodes[i].ID()).(graph.NodeSlicer).NodeSlice()...)
|
||||
actualFrom := append([]graph.Node{}, actual.From(actualNodes[i].ID()).(graph.NodeSlicer).NodeSlice()...)
|
||||
sort.Sort(gonumByUID(expectedFrom))
|
||||
sort.Sort(gonumByUID(actualFrom))
|
||||
if len(expectedFrom) != len(actualFrom) {
|
||||
|
Loading…
Reference in New Issue
Block a user