From 90609274cc961edfaece236a8cebf02bbbecadc2 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Sat, 7 Dec 2024 22:25:39 +0900 Subject: [PATCH] gh-212 Minor fixes for dual-stack NAT64 support --- pkg/agent/manager/loadbalancer/loadbalancer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/agent/manager/loadbalancer/loadbalancer.go b/pkg/agent/manager/loadbalancer/loadbalancer.go index 813dcf9..2942cf8 100644 --- a/pkg/agent/manager/loadbalancer/loadbalancer.go +++ b/pkg/agent/manager/loadbalancer/loadbalancer.go @@ -402,6 +402,7 @@ func (m *Manager) addLoadBalancer(svc *corev1.Service) error { livenessCheck := false lbMode := -1 addrType := "ipv4" + epAddrType := "ipv4" timeout := 30 * 60 probeType := "" probePort := 0 @@ -438,6 +439,9 @@ func (m *Manager) addLoadBalancer(svc *corev1.Service) error { ipPool := m.ipPoolTbl[defaultPoolName] if addrType == "ipv6" || addrType == "ipv6to4" { ipPool = m.ip6PoolTbl[defaultPoolName] + if addrType == "ipv6" { + epAddrType = addrType + } } // Check for loxilb specific annotations - poolName @@ -664,7 +668,7 @@ func (m *Manager) addLoadBalancer(svc *corev1.Service) error { cacheKey := GenKey(svc.Namespace, svc.Name) lbCacheEntry, added := m.lbCache[cacheKey] - endpointIPs, err := m.getEndpoints(svc, usePodNet, needMultusEP, addrType, matchNodeLabel) + endpointIPs, err := m.getEndpoints(svc, usePodNet, needMultusEP, epAddrType, matchNodeLabel) if err != nil { if !added { klog.Errorf("getEndpoints return error. err: %v", err)