Skip to content

Commit e0e8f18

Browse files
committed
feat(natgw): give pod_ips to bgp speakre to prioritize IPv4 over IPv6
When running DualStack with IPv6 before IPv4 in the podCIDR, the podIP env variable will contain an IPv6, which is not a valid router ID. This causes GoBGP to crash, failing to properly serialize its own routerID inthe BGPOpen message. The NAT GW already has code to infer the routerID from the podIPs, and will prioritize IPv4s. We just didn't pass it through the correct env variable when the speaker is in a NAT gateway Signed-off-by: SkalaNetworks <contact@skala.network>
1 parent d506cb3 commit e0e8f18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/util/vpc_nat_gateway.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ func GenNatGwBgpSpeakerContainer(speakerParams kubeovnv1.VpcBgpSpeaker, speakerI
157157
},
158158
},
159159
},
160+
{
161+
Name: "POD_IPS",
162+
ValueFrom: &corev1.EnvVarSource{
163+
FieldRef: &corev1.ObjectFieldSelector{
164+
FieldPath: "status.podIPs",
165+
},
166+
},
167+
},
160168
},
161169
Args: args,
162170
}

0 commit comments

Comments
 (0)