diff --git a/proxy/pkg/proxy/proxy.go b/proxy/pkg/proxy/proxy.go index eebe720755..d5d1b145a4 100644 --- a/proxy/pkg/proxy/proxy.go +++ b/proxy/pkg/proxy/proxy.go @@ -332,7 +332,7 @@ func isACMLabelQuery(req *http.Request) (bool, error) { } matchers := values["match[]"] - if slices.Contains(matchers, proxyconfig.RBACProxyLabelMetricName) { + if slices.Contains(matchers, proxyconfig.RBACProxyLabelMetricName+"{}") || slices.Contains(matchers, proxyconfig.RBACProxyLabelMetricName) { return true, nil } diff --git a/proxy/pkg/proxy/proxy_test.go b/proxy/pkg/proxy/proxy_test.go index 8927aeeba6..4416da6e0b 100644 --- a/proxy/pkg/proxy/proxy_test.go +++ b/proxy/pkg/proxy/proxy_test.go @@ -346,6 +346,14 @@ func TestHandleManagedClusterLabelQuery(t *testing.T) { body: nil, expectedToHandle: false, }, + { + name: "should handle GET to label values endpoint with correct metric", + method: "GET", + path: "/api/v1/label/label_name/values?match[]=" + config.RBACProxyLabelMetricName + "{}", + body: nil, + expectedToHandle: true, + expectedBody: `{"status":"success","data":["cloud","cluster_open_cluster_management_io_clusterset","name","vendor"]}`, + }, { name: "should handle GET to label values endpoint with correct metric", method: "GET",