From a01971d47b22d4156ae99b72817636ca516a0c08 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: Mon, 13 Jan 2025 17:31:02 +0800 Subject: [PATCH] fix: create route failure 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/controller/apigateway/api_gateway_route.go b/api/controller/apigateway/api_gateway_route.go index de8a2d4bb..054f0baf1 100644 --- a/api/controller/apigateway/api_gateway_route.go +++ b/api/controller/apigateway/api_gateway_route.go @@ -198,7 +198,9 @@ func (g Struct) CreateHTTPAPIRoute(w http.ResponseWriter, r *http.Request) { defaultDomain := r.URL.Query().Get("default") == "true" for _, sl := range sLabel { - labels[sl] = "service_alias" + if sl != "" { + labels[sl] = "service_alias" + } } c := k8s.Default().ApiSixClient.ApisixV2()