1
0
Fork 0

Respect service.nativelb=false annotation when nativeLBByDefault is enabled

This commit is contained in:
Simon Delicata 2025-07-08 11:58:04 +02:00 committed by GitHub
parent d674b393a8
commit cdacf0bca8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 669 additions and 13 deletions

View file

@ -918,7 +918,12 @@ func (p *Provider) getBackendAddresses(namespace string, ref gatev1.BackendRef)
return nil, corev1.ServicePort{}, fmt.Errorf("parsing service annotations config: %w", err)
}
if p.NativeLBByDefault || annotationsConfig.Service.NativeLB {
nativeLB := p.NativeLBByDefault
if annotationsConfig.Service.NativeLB != nil {
nativeLB = *annotationsConfig.Service.NativeLB
}
if nativeLB {
if service.Spec.ClusterIP == "" || service.Spec.ClusterIP == "None" {
return nil, corev1.ServicePort{}, fmt.Errorf("no clusterIP found for service: %s/%s", service.Namespace, service.Name)
}