Skip to content

Commit

Permalink
[IPv6] Improve comment and update the doc (#1538)
Browse files Browse the repository at this point in the history
* Improve comments in node_route_controller_test
  • Loading branch information
lzhecheng committed Nov 16, 2020
1 parent 7292f1e commit 55e1fc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/agent/controller/noderoute/node_route_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ func TestControllerWithDuplicatePodCIDR(t *testing.T) {
defer close(finishCh)

c.clientset.CoreV1().Nodes().Create(context.TODO(), node1, metav1.CreateOptions{})
// The 2nd argument is Any() because it is not safe to use pointer as key in a map. peerConfigs map[*net.IPNet]net.IP
// The 2nd argument is Any() because the argument is unpredictable when it uses pointer as the key of map.
// The argument type is map[*net.IPNet]net.IP.
c.ofClient.EXPECT().InstallNodeFlows("node1", gatewayMAC, gomock.Any(), nodeIP1, uint32(config.DefaultTunOFPort), uint32(0)).Times(1)
c.routeClient.EXPECT().AddRoutes(podCIDR, nodeIP1, podCIDRGateway).Times(1)
c.processNextWorkItem()
Expand All @@ -140,7 +141,8 @@ func TestControllerWithDuplicatePodCIDR(t *testing.T) {
c.processNextWorkItem()

// After node1 is deleted, routes and flows should be installed for node2 successfully.
// The 2nd argument is Any() because it is not safe to use pointer as key in a map. peerConfigs map[*net.IPNet]net.IP
// The 2nd argument is Any() because the argument is unpredictable when it uses pointer as the key of map.
// The argument type is map[*net.IPNet]net.IP.
c.ofClient.EXPECT().InstallNodeFlows("node2", gatewayMAC, gomock.Any(), nodeIP2, uint32(config.DefaultTunOFPort), uint32(0)).Times(1)
c.routeClient.EXPECT().AddRoutes(podCIDR, nodeIP2, podCIDRGateway).Times(1)
c.processNextWorkItem()
Expand Down

0 comments on commit 55e1fc2

Please sign in to comment.