Skip to content

Commit 206edbc

Browse files
committed
add namespaces back
Signed-off-by: Haywood Shannon <[email protected]> Signed-off-by: Haywood Shannon <[email protected]>
1 parent 4297b95 commit 206edbc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

internal/k8s/controller.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,7 @@ func (lbc *LoadBalancerController) createVirtualServerEx(virtualServer *conf_v1.
24742474
if u.UseClusterIP {
24752475
s, err := lbc.getServiceForUpstream(serviceNamespace, serviceName, u.Port)
24762476
if err != nil {
2477-
nl.Warnf(lbc.Logger, "Error getting Service for Upstream %v: %v", u.Service, err)
2477+
nl.Warnf(lbc.Logger, "Error getting Service for Upstream %v/%v: %v", serviceNamespace, u.Service, err)
24782478
} else {
24792479
endps = append(endps, ipv6SafeAddrPort(s.Spec.ClusterIP, int32(u.Port)))
24802480
}
@@ -2622,7 +2622,7 @@ func (lbc *LoadBalancerController) createVirtualServerEx(virtualServer *conf_v1.
26222622
if u.UseClusterIP {
26232623
s, err := lbc.getServiceForUpstream(serviceNamespace, serviceName, u.Port)
26242624
if err != nil {
2625-
nl.Warnf(lbc.Logger, "Error getting Service for Upstream %v: %v", u.Service, err)
2625+
nl.Warnf(lbc.Logger, "Error getting Service for Upstream %v/%v: %v", serviceNamespace, serviceName, err)
26262626
} else {
26272627
endps = append(endps, fmt.Sprintf("%s:%d", s.Spec.ClusterIP, u.Port))
26282628
}
@@ -2981,14 +2981,14 @@ func (lbc *LoadBalancerController) getEndpointsForSubselector(namespace string,
29812981
if port.Port == int32(servicePort) {
29822982
targetPort, err = lbc.getTargetPort(port, svc)
29832983
if err != nil {
2984-
return nil, fmt.Errorf("error determining target port for port %v in service %v: %w", servicePort, svc.Name, err)
2984+
return nil, fmt.Errorf("error determining target port for port %v in service %v/%v: %w", servicePort, svc.Namespace, svc.Name, err)
29852985
}
29862986
break
29872987
}
29882988
}
29892989

29902990
if targetPort == 0 {
2991-
return nil, fmt.Errorf("no port %v in service %s", servicePort, svc.Name)
2991+
return nil, fmt.Errorf("no port %v in service %s/%s", servicePort, svc.Namespace, svc.Name)
29922992
}
29932993

29942994
endps, err = lbc.getEndpointsForServiceWithSubselector(targetPort, subselector, svc)
@@ -3010,7 +3010,7 @@ func (lbc *LoadBalancerController) getEndpointsForServiceWithSubselector(targetP
30103010
var svcEndpointSlices []discovery_v1.EndpointSlice
30113011
svcEndpointSlices, err = nsi.endpointSliceLister.GetServiceEndpointSlices(svc)
30123012
if err != nil {
3013-
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s from the cache: %v", svc.Name, err)
3013+
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s/%s from the cache: %v", svc.Namespace, svc.Name, err)
30143014
return nil, err
30153015
}
30163016

@@ -3164,13 +3164,13 @@ func (lbc *LoadBalancerController) getEndpointsForIngressBackend(backend *networ
31643164
result = lbc.getExternalEndpointsForIngressBackend(backend, svc)
31653165
return result, true, nil
31663166
}
3167-
nl.Debugf(lbc.Logger, "Error getting endpoints for service %s from the cache: %v", svc.Name, err)
3167+
nl.Debugf(lbc.Logger, "Error getting endpoints for service %s/%s from the cache: %v", svc.Namespace, svc.Name, err)
31683168
return nil, false, err
31693169
}
31703170

31713171
result, err = lbc.getEndpointsForPortFromEndpointSlices(endpointSlices, backend.Service.Port, svc)
31723172
if err != nil {
3173-
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s port %v: %v", svc.Name, configs.GetBackendPortAsString(backend.Service.Port), err)
3173+
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s/%s port %v: %v", svc.Namespace, svc.Name, configs.GetBackendPortAsString(backend.Service.Port), err)
31743174
return nil, false, err
31753175
}
31763176
return result, false, nil
@@ -3191,7 +3191,7 @@ func (lbc *LoadBalancerController) getEndpointsForPortFromEndpointSlices(endpoin
31913191
}
31923192

31933193
if targetPort == 0 {
3194-
return nil, fmt.Errorf("no port %v in service %s", backendPort, svc.Name)
3194+
return nil, fmt.Errorf("no port %v in service %s/%s", backendPort, svc.Namespace, svc.Name)
31953195
}
31963196

31973197
makePodEndpoints := func(port int32, epx []discovery_v1.Endpoint) []podEndpoint {
@@ -3281,7 +3281,7 @@ func (lbc *LoadBalancerController) getTargetPort(svcPort api_v1.ServicePort, svc
32813281
}
32823282

32833283
if len(pods) == 0 {
3284-
return 0, fmt.Errorf("no pods of service %s", svc.Name)
3284+
return 0, fmt.Errorf("no pods of service %s/%s", svc.Namespace, svc.Name)
32853285
}
32863286

32873287
pod := pods[0]

0 commit comments

Comments
 (0)