New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resourcemanager: do not check existence when add resource group #6717
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: glorv <glorvs@163.com>
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #6717 +/- ##
==========================================
+ Coverage 74.30% 74.63% +0.32%
==========================================
Files 410 417 +7
Lines 42853 43625 +772
==========================================
+ Hits 31842 32558 +716
- Misses 8158 8181 +23
- Partials 2853 2886 +33
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
@@ -789,7 +789,7 @@ func (suite *resourceManagerClientTestSuite) TestBasicResourceGroupCURD() { | |||
} | |||
// Create Resource Group | |||
resp, err := cli.AddResourceGroup(suite.ctx, group) | |||
checkErr(err, tcase.addSuccess) | |||
checkErr(err, true) | |||
if tcase.addSuccess { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to change addSuccess
name to meet now the test AddResourceGroup behavior will actually succeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: glorv <glorvs@163.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some comment for this behavior? REST LGTM
_, ok := m.groups[grouppb.Name] | ||
m.RUnlock() | ||
if ok { | ||
return errs.ErrResourceGroupAlreadyExists.FastGenByArgs(grouppb.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove the ErrResourceGroupAlreadyExists
related error definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Signed-off-by: glorv <glorvs@163.com>
/merge |
@CabinfeverB: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 4b9be9c
|
In response to a cherrypick label: new pull request created to branch |
… (#6739) ref #5851, ref pingcap/tidb#45050 Signed-off-by: glorv <glorvs@163.com> Co-authored-by: glorv <glorvs@163.com> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
What problem does this PR solve?
Issue Number: ref #5851, ref pingcap/tidb#45050
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note