Skip to content

Commit

Permalink
check if externalIds map is nil when add node as gw for centralized s…
Browse files Browse the repository at this point in the history
…ubnet (#2088)
  • Loading branch information
hongzhen-ma committed Nov 28, 2022
1 parent 7d2e8ea commit d76976c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,9 @@ func (c *Controller) addPolicyRouteForCentralizedSubnetOnNode(nodeName, nodeIP s
continue
}
nextHops = append(nextHops, nextHop)
if nameIpMap == nil {
nameIpMap = make(map[string]string, 1)
}
nameIpMap[nodeName] = nextHop

if err = c.updatePolicyRouteForCentralizedSubnet(subnet.Name, cidrBlock, nextHops, nameIpMap); err != nil {
Expand Down

0 comments on commit d76976c

Please sign in to comment.