AlinsRan commented on code in PR #2442:
URL:
https://github.com/apache/apisix-ingress-controller/pull/2442#discussion_r2179290265
##########
internal/provider/adc/config.go:
##########
@@ -86,24 +87,32 @@ func (d *adcClient) getConfigsForGatewayProxy(tctx
*provider.TranslateContext, g
}
_, ok := tctx.Services[namespacedName]
if !ok {
- return nil, errors.New("no service found for service
reference")
+ return nil, errors.Errorf("no service found for service
reference: %s", namespacedName)
}
- endpoint := tctx.EndpointSlices[namespacedName]
- if endpoint == nil {
- return nil, nil
- }
- upstreamNodes, err := d.translator.TranslateBackendRef(tctx,
v1.BackendRef{
- BackendObjectReference: v1.BackendObjectReference{
- Name:
v1.ObjectName(provider.ControlPlane.Service.Name),
- Port:
ptr.To(v1.PortNumber(provider.ControlPlane.Service.Port)),
- },
- })
- if err != nil {
- return nil, err
- }
- for _, node := range upstreamNodes {
- config.ServerAddrs = append(config.ServerAddrs,
fmt.Sprintf("http://%s:%d", node.Host, node.Port))
+
+ var (
+ endpointSlices = tctx.EndpointSlices[namespacedName]
+ port =
strconv.FormatInt(int64(provider.ControlPlane.Service.Port), 10)
Review Comment:
We need to match endpoints ports based on the targetPort or portName of the
service.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]