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