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


##########
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:
   Yes, only domain can be used, or more precisely, the regular expression to 
match host.
   
   ```lua
   local host_def_pat = "^\\*?[0-9a-zA-Z-._\\[\\]:]+$"
   ```
   
   ref: 
https://github.com/apache/apisix/blob/c5fc10d9355a0c177a7532f01c77745ff0639a7f/apisix/schema_def.lua#L40
   
   We can provide user-friendly error messages on ingress.



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