Skip to content

Commit

Permalink
e2e scheduling priorities: do not reference control loop variable
Browse files Browse the repository at this point in the history
Otherwise, nodeNameToPodList[nodeName] list will have all its references
identical (corresponding to the control variable reference).
Thus, making all the pods in the list identical.
  • Loading branch information
ingvagabund committed Sep 27, 2021
1 parent 8724967 commit da667a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/scheduling/priorities.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,9 @@ func podListForEachNode(cs clientset.Interface) map[string][]*v1.Pod {
if err != nil {
framework.Failf("Expect error of invalid, got : %v", err)
}
for _, pod := range allPods.Items {
for i, pod := range allPods.Items {
nodeName := pod.Spec.NodeName
nodeNameToPodList[nodeName] = append(nodeNameToPodList[nodeName], &pod)
nodeNameToPodList[nodeName] = append(nodeNameToPodList[nodeName], &allPods.Items[i])
}
return nodeNameToPodList
}
Expand Down

0 comments on commit da667a9

Please sign in to comment.