Skip to content

Commit c572321

Browse files
committed
add namespaces back
Signed-off-by: Haywood Shannon <[email protected]> Signed-off-by: Haywood Shannon <[email protected]>
1 parent ee2b551 commit c572321

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
}
@@ -2632,7 +2632,7 @@ func (lbc *LoadBalancerController) createVirtualServerEx(virtualServer *conf_v1.
26322632
if u.UseClusterIP {
26332633
s, err := lbc.getServiceForUpstream(serviceNamespace, serviceName, u.Port)
26342634
if err != nil {
2635-
nl.Warnf(lbc.Logger, "Error getting Service for Upstream %v: %v", u.Service, err)
2635+
nl.Warnf(lbc.Logger, "Error getting Service for Upstream %v/%v: %v", serviceNamespace, serviceName, err)
26362636
} else {
26372637
endps = append(endps, fmt.Sprintf("%s:%d", s.Spec.ClusterIP, u.Port))
26382638
}
@@ -3013,14 +3013,14 @@ func (lbc *LoadBalancerController) getEndpointsForSubselector(namespace string,
30133013
if port.Port == int32(servicePort) {
30143014
targetPort, err = lbc.getTargetPort(port, svc)
30153015
if err != nil {
3016-
return nil, fmt.Errorf("error determining target port for port %v in service %v: %w", servicePort, svc.Name, err)
3016+
return nil, fmt.Errorf("error determining target port for port %v in service %v/%v: %w", servicePort, svc.Namespace, svc.Name, err)
30173017
}
30183018
break
30193019
}
30203020
}
30213021

30223022
if targetPort == 0 {
3023-
return nil, fmt.Errorf("no port %v in service %s", servicePort, svc.Name)
3023+
return nil, fmt.Errorf("no port %v in service %s/%s", servicePort, svc.Namespace, svc.Name)
30243024
}
30253025

30263026
endps, err = lbc.getEndpointsForServiceWithSubselector(targetPort, subselector, svc)
@@ -3042,7 +3042,7 @@ func (lbc *LoadBalancerController) getEndpointsForServiceWithSubselector(targetP
30423042
var svcEndpointSlices []discovery_v1.EndpointSlice
30433043
svcEndpointSlices, err = nsi.endpointSliceLister.GetServiceEndpointSlices(svc)
30443044
if err != nil {
3045-
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s from the cache: %v", svc.Name, err)
3045+
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s/%s from the cache: %v", svc.Namespace, svc.Name, err)
30463046
return nil, err
30473047
}
30483048

@@ -3196,13 +3196,13 @@ func (lbc *LoadBalancerController) getEndpointsForIngressBackend(backend *networ
31963196
result = lbc.getExternalEndpointsForIngressBackend(backend, svc)
31973197
return result, true, nil
31983198
}
3199-
nl.Debugf(lbc.Logger, "Error getting endpoints for service %s from the cache: %v", svc.Name, err)
3199+
nl.Debugf(lbc.Logger, "Error getting endpoints for service %s/%s from the cache: %v", svc.Namespace, svc.Name, err)
32003200
return nil, false, err
32013201
}
32023202

32033203
result, err = lbc.getEndpointsForPortFromEndpointSlices(endpointSlices, backend.Service.Port, svc)
32043204
if err != nil {
3205-
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s port %v: %v", svc.Name, configs.GetBackendPortAsString(backend.Service.Port), err)
3205+
nl.Debugf(lbc.Logger, "Error getting endpointslices for service %s/%s port %v: %v", svc.Namespace, svc.Name, configs.GetBackendPortAsString(backend.Service.Port), err)
32063206
return nil, false, err
32073207
}
32083208
return result, false, nil
@@ -3223,7 +3223,7 @@ func (lbc *LoadBalancerController) getEndpointsForPortFromEndpointSlices(endpoin
32233223
}
32243224

32253225
if targetPort == 0 {
3226-
return nil, fmt.Errorf("no port %v in service %s", backendPort, svc.Name)
3226+
return nil, fmt.Errorf("no port %v in service %s/%s", backendPort, svc.Namespace, svc.Name)
32273227
}
32283228

32293229
makePodEndpoints := func(port int32, epx []discovery_v1.Endpoint) []podEndpoint {
@@ -3313,7 +3313,7 @@ func (lbc *LoadBalancerController) getTargetPort(svcPort api_v1.ServicePort, svc
33133313
}
33143314

33153315
if len(pods) == 0 {
3316-
return 0, fmt.Errorf("no pods of service %s", svc.Name)
3316+
return 0, fmt.Errorf("no pods of service %s/%s", svc.Namespace, svc.Name)
33173317
}
33183318

33193319
pod := pods[0]

0 commit comments

Comments
 (0)