Skip to content

Commit 985e294

Browse files
SkalaNetworkszhangzujian
authored andcommitted
fix(slr): switchlbrule doesn't support multi-homed/ipv6-first pods (#5375)
Signed-off-by: SkalaNetworks <[email protected]> Signed-off-by: zhangzujian <[email protected]>
1 parent 4205ff7 commit 985e294

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pkg/controller/endpoint.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,15 @@ func (c *Controller) getVpcSubnetName(pods []*v1.Pod, endpoints *v1.Endpoints, s
285285
LOOP:
286286
for _, subset := range endpoints.Subsets {
287287
for _, addr := range subset.Addresses {
288-
if addr.IP == pod.Status.PodIP {
289-
if vpcName == "" {
290-
vpcName = pod.Annotations[util.LogicalRouterAnnotation]
291-
}
288+
for _, podIP := range pod.Status.PodIPs {
289+
if addr.IP == podIP.IP {
290+
if vpcName == "" {
291+
vpcName = pod.Annotations[util.LogicalRouterAnnotation]
292+
}
292293

293-
if vpcName != "" {
294-
break LOOP
294+
if vpcName != "" {
295+
break LOOP
296+
}
295297
}
296298
}
297299
}

0 commit comments

Comments
 (0)