AlinsRan commented on code in PR #2442:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2442#discussion_r2179273849


##########
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:
   The service port is not always equal to the container port.
   
   



-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to