Gallardot commented on code in PR #1500:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/1500#discussion_r1047284815


##########
pkg/providers/apisix/translation/apisix_upstream.go:
##########
@@ -57,35 +55,24 @@ func (t *translator) translateService(namespace, svcName, 
subset, svcResolveGran
        return ups, nil
 }
 
-// TODO: Support Port field
 func (t *translator) TranslateApisixUpstreamExternalNodes(au 
*v2.ApisixUpstream) ([]apisixv1.UpstreamNode, error) {
        var nodes []apisixv1.UpstreamNode
        for i, node := range au.Spec.ExternalNodes {
                if node.Type == v2.ExternalTypeDomain {
-                       arr := strings.Split(node.Name, ":")
 
                        weight := translation.DefaultWeight
                        if node.Weight != nil {
                                weight = *node.Weight
                        }
                        n := apisixv1.UpstreamNode{
-                               Host:   arr[0],
+                               Host:   node.Name,

Review Comment:
   ref to apisix : 
https://github.com/apache/apisix/blob/c5fc10d9355a0c177a7532f01c77745ff0639a7f/apisix/schema_def.lua#L40
   ref to k8s : 
https://github.com/kubernetes/kubernetes/blob/976a940f4a4e84fe814583848f97b9aafcdb083f/staging/src/k8s.io/apimachinery/pkg/util/validation/validation.go#L205
   
   They define regex differently, but I think k8s's dns is more accurate.



-- 
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]

Reply via email to