From 3d11c4d12be1b77c62e41c6ad0857f8cf6ec3722 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Mon, 5 Aug 2024 17:42:38 +0800 Subject: [PATCH] client/http: fix the URI of GetRegionLabelRulesByIDs (#8490) (#8493) close tikv/pd#8491, ref pingcap/tidb#55188 Fix the URI of `GetRegionLabelRulesByIDs` to correct the call. Signed-off-by: ti-chi-bot Signed-off-by: JmPotato Co-authored-by: JmPotato --- client/http/interface.go | 2 +- tests/integrations/client/http_client_test.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/http/interface.go b/client/http/interface.go index 7b15291d9e7..75c858df19f 100644 --- a/client/http/interface.go +++ b/client/http/interface.go @@ -672,7 +672,7 @@ func (c *client) GetRegionLabelRulesByIDs(ctx context.Context, ruleIDs []string) var labelRules []*LabelRule err = c.request(ctx, newRequestInfo(). WithName(getRegionLabelRulesByIDsName). - WithURI(RegionLabelRules). + WithURI(RegionLabelRulesByIDs). WithMethod(http.MethodGet). WithBody(idsJSON). WithResp(&labelRules)) diff --git a/tests/integrations/client/http_client_test.go b/tests/integrations/client/http_client_test.go index 9efbc587847..4dfd6c8b437 100644 --- a/tests/integrations/client/http_client_test.go +++ b/tests/integrations/client/http_client_test.go @@ -451,6 +451,10 @@ func (suite *httpClientTestSuite) checkRegionLabel(mode mode, client pd.Client) re.Equal(labelRule.ID, allLabelRules[1].ID) re.Equal(labelRule.Labels, allLabelRules[1].Labels) re.Equal(labelRule.RuleType, allLabelRules[1].RuleType) + labelRules, err = client.GetRegionLabelRulesByIDs(env.ctx, []string{"rule2"}) + re.NoError(err) + re.Len(labelRules, 1) + re.Equal(labelRule, labelRules[0]) labelRules, err = client.GetRegionLabelRulesByIDs(env.ctx, []string{"keyspaces/0", "rule2"}) re.NoError(err) sort.Slice(labelRules, func(i, j int) bool {