Skip to content

Commit 3d11c4d

Browse files
ti-chi-botJmPotato
andauthored
client/http: fix the URI of GetRegionLabelRulesByIDs (#8490) (#8493)
close #8491, ref pingcap/tidb#55188 Fix the URI of `GetRegionLabelRulesByIDs` to correct the call. Signed-off-by: ti-chi-bot <[email protected]> Signed-off-by: JmPotato <[email protected]> Co-authored-by: JmPotato <[email protected]>
1 parent 85258b3 commit 3d11c4d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

client/http/interface.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ func (c *client) GetRegionLabelRulesByIDs(ctx context.Context, ruleIDs []string)
672672
var labelRules []*LabelRule
673673
err = c.request(ctx, newRequestInfo().
674674
WithName(getRegionLabelRulesByIDsName).
675-
WithURI(RegionLabelRules).
675+
WithURI(RegionLabelRulesByIDs).
676676
WithMethod(http.MethodGet).
677677
WithBody(idsJSON).
678678
WithResp(&labelRules))

tests/integrations/client/http_client_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ func (suite *httpClientTestSuite) checkRegionLabel(mode mode, client pd.Client)
451451
re.Equal(labelRule.ID, allLabelRules[1].ID)
452452
re.Equal(labelRule.Labels, allLabelRules[1].Labels)
453453
re.Equal(labelRule.RuleType, allLabelRules[1].RuleType)
454+
labelRules, err = client.GetRegionLabelRulesByIDs(env.ctx, []string{"rule2"})
455+
re.NoError(err)
456+
re.Len(labelRules, 1)
457+
re.Equal(labelRule, labelRules[0])
454458
labelRules, err = client.GetRegionLabelRulesByIDs(env.ctx, []string{"keyspaces/0", "rule2"})
455459
re.NoError(err)
456460
sort.Slice(labelRules, func(i, j int) bool {

0 commit comments

Comments
 (0)