Skip to content

Commit

Permalink
Fix IP repetition when testing IPv6 allocation
Browse files Browse the repository at this point in the history
Signed-off-by: bzsuni <[email protected]>
  • Loading branch information
bzsuni committed Nov 16, 2023
1 parent 96910f3 commit 616100d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/egressgateway/egress_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ func setEipStatus(ipv4, ipv6 string, nodeName string, policy egress.Policy, node
newEipStatus := egress.EgressIPStatus{}

for _, eip := range eipStatus.Eips {
if ipv4 == eip.IPv4 {
if (len(ipv4) != 0 && ipv4 == eip.IPv4) || (len(ipv6) != 0 && ipv6 == eip.IPv6) {
eip.Policies = append(eip.Policies, policy)

isExist = true
Expand Down

0 comments on commit 616100d

Please sign in to comment.