[WIP] Optimization for CreateOrUpdateConfigMap
What problem does this PR solve?
Close #3737
What is changed and how does it work?
Code changes
- [x] Has Go code change
- [ ] Has CI related scripts change
Tests
- [x] Unit test
- [ ] E2E test
- [x] Manual test
- [ ] No code
Side effects
- [ ] Breaking backward compatibility
- [ ] Other side effects:
Related changes
- [ ] Need to cherry-pick to the release branch
- [ ] Need to update the documentation
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.
Optimization for CreateOrUpdateConfigMap
[REVIEW NOTIFICATION]
This pull request has been approved by:
- DanielZhangQD
- july2993
To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.
The full list of commands accepted by this bot can be found here.
Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.
@mianhk Even with this PR, the function here https://github.com/pingcap/tidb-operator/blob/master/pkg/controller/generic_control.go#L425 will also call the Create API first, so it does not fix this issue thoroughly.
Codecov Report
Merging #4170 (5b0e271) into master (dc276de) will increase coverage by
0.01%. The diff coverage is70.00%.
@@ Coverage Diff @@
## master #4170 +/- ##
==========================================
+ Coverage 61.65% 61.67% +0.01%
==========================================
Files 181 181
Lines 19482 19520 +38
==========================================
+ Hits 12011 12038 +27
- Misses 6313 6315 +2
- Partials 1158 1167 +9
| Flag | Coverage Δ | |
|---|---|---|
| unittest | 61.67% <70.00%> (+0.01%) |
:arrow_up: |
@mianhk Even with this PR, the function here https://github.com/pingcap/tidb-operator/blob/master/pkg/controller/generic_control.go#L425 will also call the
CreateAPI first, so it does not fix this issue thoroughly.
I fixed this by CheckAndUpdateConfigMap and check the configMap by ConfigMapLister. And if is it necessary to create or upgrade other resources before after checking by Listers.
/run-all-tests
/run-all-tests
/merge
This pull request has been accepted and is ready to merge.
/run-all-tests
/run-all-tests
/run-all-tests
/run-all-tests
/test pull-e2e-kind-serial
/run-all-tests
/run-all-tests
/run-all-tests
/run-all-tests
/run-all-tests
/run-all-tests
/run-all-tests
/run-all-tests
/run-all-tests
/merge
This pull request has been accepted and is ready to merge.
/run-all-tests
/run-all-tests
/test pull-e2e-kind-br
/test pull-e2e-kind
/run-all-tests
/test pull-e2e-kind