Skip to content

Commit

Permalink
fix: not delete route and svc (#2098)
Browse files Browse the repository at this point in the history
Signed-off-by: 张启航 <[email protected]>
  • Loading branch information
ZhangSetSail authored Dec 16, 2024
1 parent 531c350 commit f6d0b40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/controller/apigateway/api_gateway_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ func (g Struct) CreateTCPRoute(w http.ResponseWriter, r *http.Request) {
// Service doesn't exist, create a new one
logrus.Infof("Service %s does not exist, creating a new service", name)
labels := make(map[string]string)
labels["creator"] = "Rainbond"
labels["tcp"] = "true"
labels["app_id"] = r.URL.Query().Get("appID")
labels["service_id"] = r.URL.Query().Get("service_id")
Expand Down
2 changes: 1 addition & 1 deletion api/controller/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ func (t *TenantStruct) DeleteSingleServiceInfo(w http.ResponseWriter, r *http.Re
service := r.Context().Value(ctxutil.ContextKey("service")).(*dbmodel.TenantServices)

err := k8s.Default().ApiSixClient.ApisixV2().ApisixRoutes(tenant.Namespace).DeleteCollection(r.Context(), v1.DeleteOptions{}, v1.ListOptions{
LabelSelector: "service_alias=" + service.ServiceAlias,
LabelSelector: service.ServiceAlias + "service_alias=",
})
if err != nil {
logrus.Errorf("delete apisix route error: %v", err)
Expand Down

0 comments on commit f6d0b40

Please sign in to comment.