From 717f11cbcd2d3baf20b4fccb1a9ff99aea6dfce7 Mon Sep 17 00:00:00 2001 From: xiaopeng Date: Sun, 15 May 2022 18:18:26 +0800 Subject: [PATCH] fix ckube watch --- api/proxy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/proxy.go b/api/proxy.go index 3b124bc..23fa34d 100644 --- a/api/proxy.go +++ b/api/proxy.go @@ -411,6 +411,11 @@ func isWatchRequest(r *http.Request) bool { func proxyPassWatch(r *ReqContext, cluster string) interface{} { q := r.Request.URL.Query() q.Set("timeout", "30m") + if v, ok := q["labelSelector"]; ok { + if len(v) == 1 && v[0] == "" { + delete(q, "labelSelector") + } + } r.Request.URL.RawQuery = q.Encode() u := r.Request.URL.String() log.Debugf("proxyPass url: %s", u)