Skip to content

Commit

Permalink
distinguish nat ip for central subnet with ecmp and active-standby (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Aug 3, 2023
1 parent 460655c commit 935fa92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/daemon/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ func (c *Controller) getEgressNatIpByNode(nodeName string) (map[string]string, e
for _, cidr := range strings.Split(subnet.Spec.CIDRBlock, ",") {
for _, gw := range strings.Split(subnet.Spec.GatewayNode, ",") {
if strings.Contains(gw, ":") && util.GatewayContains(gw, nodeName) && util.CheckProtocol(cidr) == util.CheckProtocol(strings.Split(gw, ":")[1]) {
subnetsNatIp[cidr] = strings.TrimSpace(strings.Split(gw, ":")[1])
if subnet.Status.ActivateGateway == nodeName {
subnetsNatIp[cidr] = strings.TrimSpace(strings.Split(gw, ":")[1])
}
break
}
}
Expand Down

0 comments on commit 935fa92

Please sign in to comment.