tidb-operator
tidb-operator copied to clipboard
Refactor start script and support start script v2
What problem does this PR solve?
Close #4393
What is changed and how does it work?
- create pkg
pkg/manager/member/startscript/v2
, and mvtemplate.go
to pkgpkg/manager/member/startscript/v1
- separate
render
func topkg/manager/member/startscript
- add
startScriptVersion
in tc spec to choose startscript
Code changes
- [x] Has Go code change
- [ ] Has CI related scripts change
Tests
- [x] Unit test
- [x] E2E test
- [ ] Manual test
Deploy new cluster:
- deploy cluster with
startScriptVersion:v1
- deploy cluster with
startScriptVersion:v1
and tls-enabled - deploy cluster with
startScriptVersion:v2
- deploy cluster with `startScriptVersion:v2 and tls-enabled
For compatibility:
- deploy cluster by v1.3.2 operator, then upgrade it, check that cluster have not rolling upgrade.
- deploy cluster by v1.3.2 operator, then upgrade it and use
startScriptVersion:v1
, check that the cluster have not rolling upgrade. - deploy cluster by v1.3.2 operator, then use
startScriptVersion:v2
, wait for cluster to be ready and check that the args of all components have not changed.
Debug mod:
- Deploy cluster with
startScriptVersion:v2
, and try to enable debug mod for all components.
- [ ] 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.
Add `startScriptVersion` field to choose startscript for all components
[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.
Codecov Report
Merging #4505 (f0cef8a) into master (45c6120) will increase coverage by
10.00%
. The diff coverage is95.73%
.
@@ Coverage Diff @@
## master #4505 +/- ##
===========================================
+ Coverage 63.09% 73.10% +10.00%
===========================================
Files 186 200 +14
Lines 21131 23817 +2686
===========================================
+ Hits 13333 17411 +4078
+ Misses 6574 5207 -1367
+ Partials 1224 1199 -25
Flag | Coverage Δ | |
---|---|---|
e2e | 59.92% <88.06%> (?) |
|
unittest | 63.59% <88.75%> (+0.49%) |
:arrow_up: |
/test pull-e2e-kind pull-e2e-kind-serial
/run-all-tests
@KanShiori Did you check that debug mode works as expected for each supported component with v1 and v2 after this PR?
@KanShiori Did you check that debug mode works as expected for each supported component with v1 and v2 after this PR?
Yes, I did
/run-all-tests
/test pull-e2e-kind-across-kubernetes
/test pull-e2e-kind pull-e2e-kind-across-kubernetes pull-e2e-kind-serial
/test pull-e2e-kind-br pull-e2e-kind-serial pull-e2e-kind-tikv-scale-simultaneously pull-e2e-kind-tngm
/test pull-e2e-kind-br pull-e2e-kind-serial
/merge
This pull request has been accepted and is ready to merge.
/test pull-e2e-kind-serial
/test pull-e2e-kind pull-e2e-kind-basic pull-e2e-kind-serial
/test pull-e2e-kind pull-e2e-kind-basic pull-e2e-kind-serial
/test pull-e2e-kind-serial
/test pull-e2e-kind
/test pull-e2e-kind pull-e2e-kind-serial
/merge
This pull request has been accepted and is ready to merge.
/test pull-e2e-kind
/test pull-e2e-kind
/test pull-e2e-kind
/test pull-e2e-kind-br pull-e2e-kind-serial
/merge pull-e2e-kind pull-e2e-kind-br pull-e2e-kind-serial
/test pull-e2e-kind pull-e2e-kind-br pull-e2e-kind-serial
/test pull-e2e-kind
/test pull-e2e-kind
/test pull-e2e-kind