fix(pd): fix the pd name of tc with across k8s opt (#4721)
cherry-pick #4721 to release-1.3 You can switch your code base to this Pull Request by using git-extras:
# In tidb-operator repo:
git pr https://github.com/pingcap/tidb-operator/pull/4728
After apply modifications, you can push your change to this PR via:
git push [email protected]:ti-srebot/tidb-operator.git pr/4728:release-1.3-fe6bef812f8a
What problem does this PR solve?
Now if spec.acrossK8s is set but spec.clusterDomain is empty in TC, the upgrading process of PD will be blocked because the name of pd in status is mismatched with the return result of function PdName.
For now, if spec.clusterDomain is empty, the PdName will return pod name whether spec.acrossK8s is true or false. However, if spec.acrossK8s is true, the real pd name generated by start-script is the full domain name.
After this PR merged, PdName will also return full domain name when spec.acrossK8s is true
What is changed and how does it work?
Code changes
- [x] Has Go code change
- [ ] Has CI related scripts change
Tests
- [ ] Unit test
- [ ] E2E test
- [x] Manual test
- [ ] No code
Side effects
- [ ] Breaking backward compatibility
- [ ] Other side effects:
Related changes
- [x] 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.
[REVIEW NOTIFICATION]
This pull request has been approved by:
- KanShiori
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.
@liubog2008 you're already a collaborator in bot's repo.
/merge
This pull request has been accepted and is ready to merge.
Codecov Report
Merging #4728 (173000b) into release-1.3 (2236cd5) will increase coverage by
9.99%. The diff coverage is100.00%.
Additional details and impacted files
@@ Coverage Diff @@
## release-1.3 #4728 +/- ##
===============================================
+ Coverage 62.36% 72.36% +9.99%
===============================================
Files 186 190 +4
Lines 20867 23340 +2473
===============================================
+ Hits 13014 16890 +3876
+ Misses 6638 5246 -1392
+ Partials 1215 1204 -11
| Flag | Coverage Δ | |
|---|---|---|
| e2e | 59.97% <100.00%> (?) |
|
| unittest | 62.37% <66.66%> (+<0.01%) |
:arrow_up: |
/test pull-e2e-kind
/test pull-e2e-kind-across-kubernetes
@ti-srebot: Your PR was out of date, I have automatically updated it for you.
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.
/test pull-e2e-kind-across-kubernetes pull-e2e-kind