Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR - skip loxilb class check if multus annotation exists #113

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pkg/agent/manager/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,11 @@ func (m *Manager) syncLoadBalancer(lb LbCacheKey) error {
func (m *Manager) addLoadBalancer(svc *corev1.Service) error {
// check LoadBalancerClass
lbClassName := svc.Spec.LoadBalancerClass
if lbClassName == nil {

// Check for loxilb specific annotation - Multus Networks
_, needPodEP := svc.Annotations[LoxiMultusServiceAnnotation]
if lbClassName == nil && !needPodEP {
klog.V(4).Infof("service %s/%s missing loadBalancerClass & multus annotation", svc.Namespace, svc.Name)
return nil
}

Expand Down Expand Up @@ -351,7 +355,7 @@ func (m *Manager) addLoadBalancer(svc *corev1.Service) error {
prefLocal = true
}

if strings.Compare(*lbClassName, m.networkConfig.LoxilbLoadBalancerClass) != 0 {
if strings.Compare(*lbClassName, m.networkConfig.LoxilbLoadBalancerClass) != 0 && !needPodEP {
return nil
}

Expand Down Expand Up @@ -510,8 +514,6 @@ func (m *Manager) addLoadBalancer(svc *corev1.Service) error {
numSecondarySvc = 0
}

// Check for loxilb specific annotation - Multus Networks
_, needPodEP := svc.Annotations[LoxiMultusServiceAnnotation]
endpointIPs, err := m.getEndpoints(svc, needPodEP, addrType)
if err != nil {
return err
Expand Down
Loading