ronething commented on code in PR #2578:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2578#discussion_r2386520417


##########
api/adc/types.go:
##########
@@ -482,18 +482,21 @@ func ComposeRouteName(namespace, name string, rule 
string) string {
 
 // ComposeStreamRouteName uses namespace, name and rule name to compose
 // the stream_route name.
-func ComposeStreamRouteName(namespace, name string, rule string) string {
+func ComposeStreamRouteName(namespace, name string, rule string, typ string) 
string {
+       if typ == "" {
+               typ = "TCP"
+       }
        // FIXME Use sync.Pool to reuse this buffer if the upstream
        // name composing code path is hot.
-       p := make([]byte, 0, len(namespace)+len(name)+len(rule)+6)
+       p := make([]byte, 0, len(namespace)+len(name)+len(rule)+len(typ)+6)
        buf := bytes.NewBuffer(p)
 
        buf.WriteString(namespace)
        buf.WriteByte('_')
        buf.WriteString(name)
        buf.WriteByte('_')
        buf.WriteString(rule)
-       buf.WriteString("_tcp")
+       buf.WriteString(typ)

Review Comment:
   这里没有了 `_`,跟原先的规则不一致,并且上面的 p 需要修改,不是 +6 应该是 + 3?
   
   ```
   buf.WriteString(rule)
   buf.WriteByte('_')
   buf.WriteString(typ)
   ```



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