Skip to content

Commit

Permalink
fix: create outer svc error (#2108)
Browse files Browse the repository at this point in the history
Signed-off-by: 张启航 <[email protected]>
  • Loading branch information
ZhangSetSail authored Dec 19, 2024
1 parent e3fae94 commit b172030
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions api/controller/apigateway/api_gateway_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,6 @@ func (g Struct) CreateTCPRoute(w http.ResponseWriter, r *http.Request) {
}

serviceName := apisixRouteStream.Backend.ServiceName
name := serviceName
if r.URL.Query().Get("port") != "" {
name = fmt.Sprintf("%s-%s", serviceName, strings.ToLower(apisixRouteStream.Protocol))
name = name + "-" + r.URL.Query().Get("port")
}
logrus.Infof("apisixRouteStream.Match.IngressPort is %v", apisixRouteStream.Match.IngressPort)
if apisixRouteStream.Match.IngressPort == 0 {
logrus.Infof("change ingressPort")
Expand All @@ -372,6 +367,7 @@ func (g Struct) CreateTCPRoute(w http.ResponseWriter, r *http.Request) {
}
apisixRouteStream.Match.IngressPort = int32(res)
}
name := fmt.Sprintf("%v-%v", serviceName, apisixRouteStream.Match.IngressPort)
spec := corev1.ServiceSpec{
Ports: []corev1.ServicePort{
{
Expand Down

0 comments on commit b172030

Please sign in to comment.