From 74f30573b47399119925959754dfa7dd8c9d158d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=AF=E8=88=AA?= <101104760+ZhangSetSail@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:28:55 +0800 Subject: [PATCH] fix: add log (#2038) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com> --- api/controller/apigateway/api_gateway_route.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/controller/apigateway/api_gateway_route.go b/api/controller/apigateway/api_gateway_route.go index 4d1d5b8e5..1dbb48cfa 100644 --- a/api/controller/apigateway/api_gateway_route.go +++ b/api/controller/apigateway/api_gateway_route.go @@ -202,10 +202,14 @@ func (g Struct) CreateHTTPAPIRoute(w http.ResponseWriter, r *http.Request) { routeName = strings.ReplaceAll(routeName, "*", "s-s") for _, host := range apisixRouteHTTP.Match.Hosts { + logrus.Infof("-------------%v---------------", host) labels[host] = "host" + labelSelector := host + "=host" roueList, err := c.ApisixRoutes(tenant.Namespace).List(r.Context(), v1.ListOptions{ - LabelSelector: host + "=host", + LabelSelector: labelSelector, }) + logrus.Infof("---------------%v-------------", labelSelector) + logrus.Infof("---------------%v-------------", roueList) if err != nil { logrus.Errorf("list check route failure: %v", err) httputil.ReturnBcodeError(r, w, bcode.ErrRouteNotFound)