tidb-operator icon indicating copy to clipboard operation
tidb-operator copied to clipboard

Refactor start script and support start script v2

Open KanShiori opened this issue 2 years ago • 27 comments

What problem does this PR solve?

Close #4393

What is changed and how does it work?

  • create pkg pkg/manager/member/startscript/v2, and mv template.go to pkg pkg/manager/member/startscript/v1
  • separate render func to pkg/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 

KanShiori avatar Apr 12 '22 03:04 KanShiori

[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.

ti-chi-bot avatar Apr 12 '22 03:04 ti-chi-bot

Codecov Report

Merging #4505 (f0cef8a) into master (45c6120) will increase coverage by 10.00%. The diff coverage is 95.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:

codecov-commenter avatar Apr 12 '22 03:04 codecov-commenter

/test pull-e2e-kind pull-e2e-kind-serial

KanShiori avatar Apr 21 '22 13:04 KanShiori

/run-all-tests

KanShiori avatar May 13 '22 07:05 KanShiori

@KanShiori Did you check that debug mode works as expected for each supported component with v1 and v2 after this PR?

DanielZhangQD avatar May 16 '22 02:05 DanielZhangQD

@KanShiori Did you check that debug mode works as expected for each supported component with v1 and v2 after this PR?

Yes, I did

KanShiori avatar May 16 '22 03:05 KanShiori

/run-all-tests

KanShiori avatar May 23 '22 05:05 KanShiori

/test pull-e2e-kind-across-kubernetes

KanShiori avatar May 23 '22 09:05 KanShiori

/test pull-e2e-kind pull-e2e-kind-across-kubernetes pull-e2e-kind-serial

KanShiori avatar Aug 09 '22 02:08 KanShiori

/test pull-e2e-kind-br pull-e2e-kind-serial pull-e2e-kind-tikv-scale-simultaneously pull-e2e-kind-tngm

KanShiori avatar Aug 10 '22 09:08 KanShiori

/test pull-e2e-kind-br pull-e2e-kind-serial

KanShiori avatar Aug 10 '22 12:08 KanShiori

/merge

KanShiori avatar Aug 10 '22 14:08 KanShiori

This pull request has been accepted and is ready to merge.

Commit hash: 0394fa3691184eaddc8eadd7a2c9139cd9f62f8e

ti-chi-bot avatar Aug 10 '22 14:08 ti-chi-bot

/test pull-e2e-kind-serial

KanShiori avatar Aug 10 '22 14:08 KanShiori

/test pull-e2e-kind pull-e2e-kind-basic pull-e2e-kind-serial

KanShiori avatar Aug 11 '22 01:08 KanShiori

/test pull-e2e-kind pull-e2e-kind-basic pull-e2e-kind-serial

KanShiori avatar Aug 11 '22 01:08 KanShiori

/test pull-e2e-kind-serial

KanShiori avatar Aug 11 '22 01:08 KanShiori

/test pull-e2e-kind

KanShiori avatar Aug 11 '22 01:08 KanShiori

/test pull-e2e-kind pull-e2e-kind-serial

KanShiori avatar Aug 11 '22 08:08 KanShiori

/merge

KanShiori avatar Aug 11 '22 08:08 KanShiori

This pull request has been accepted and is ready to merge.

Commit hash: 581268117adca74443ccc3b312360be9d6e88a40

ti-chi-bot avatar Aug 11 '22 08:08 ti-chi-bot

/test pull-e2e-kind

KanShiori avatar Aug 11 '22 12:08 KanShiori

/test pull-e2e-kind

KanShiori avatar Aug 11 '22 15:08 KanShiori

/test pull-e2e-kind

KanShiori avatar Aug 12 '22 00:08 KanShiori

/test pull-e2e-kind-br pull-e2e-kind-serial

KanShiori avatar Aug 12 '22 04:08 KanShiori

/merge pull-e2e-kind pull-e2e-kind-br pull-e2e-kind-serial

KanShiori avatar Aug 13 '22 07:08 KanShiori

/test pull-e2e-kind pull-e2e-kind-br pull-e2e-kind-serial

KanShiori avatar Aug 15 '22 01:08 KanShiori

/test pull-e2e-kind

KanShiori avatar Aug 15 '22 05:08 KanShiori

/test pull-e2e-kind

KanShiori avatar Aug 15 '22 08:08 KanShiori

/test pull-e2e-kind

KanShiori avatar Aug 15 '22 10:08 KanShiori