-
Notifications
You must be signed in to change notification settings - Fork 499
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
tidb: support add location labels #4663
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. |
Codecov Report
@@ Coverage Diff @@
## master #4663 +/- ##
==========================================
+ Coverage 62.64% 72.40% +9.76%
==========================================
Files 186 190 +4
Lines 20853 23413 +2560
==========================================
+ Hits 13063 16953 +3890
+ Misses 6593 5273 -1320
+ Partials 1197 1187 -10
|
@DanielZhangQD @handlerww PTAL |
/test pull-e2e-kind-across-kubernetes |
/run-e2e-tests |
/test pull-e2e-kind |
return fmt.Errorf("encode labels to json failed, error: %v", err) | ||
} | ||
|
||
url := fmt.Sprintf("%s/labels", c.getBaseURL(tc, ordinal)) |
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.
Does it works?
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.
The PR in tidb side pingcap/tidb#36845 is merged.
/test pull-e2e-kind pull-e2e-kind-serial |
/test pull-e2e-kind-serial |
/test pull-e2e-kind pull-e2e-kind-serial |
@KanShiori @handlerww PTAL |
|
||
pod, err := m.deps.PodLister.Pods(ns).Get(name) | ||
if err != nil { | ||
return setCount, fmt.Errorf("setServerLabels: failed to get pods %s for cluster %s/%s, error: %s", name, ns, tc.GetName(), err) | ||
} | ||
|
||
nodeName := pod.Spec.NodeName |
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.
How about using the node name in tidb status, see L1042
@KanShiori PTAL again, thank you |
@glorv I left some advice about version check. BTW, please test this feature and add the result in the |
I have update the version change and manual test result. PTAL again thanks @KanShiori |
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, thanks a lot!
@DanielZhangQD @handlerww PTAL |
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
/merge |
@glorv: In response to this:
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. |
@KanShiori Shall we merge this PR now? |
/run-e2e-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: cb9f4e9
|
/test pull-e2e-kind-serial |
1 similar comment
/test pull-e2e-kind-serial |
@glorv why doesn't this PR include release notes? |
What problem does this PR solve?
What is changed and how does it work?
Code changes
Tests
kind-control-plane
with a new labeltopology.kubernetes.io/zone: test
. Then I add a pd configlocation-labels = ["topology.kubernetes.io/zone", "kubernetes.io/hostname"]
to "example/basic/tidb-cluster.yaml" and deploy it to set up a cluster. When set the cluster version with 6.1.0, there is no logs about set tidb lables as expected. Then I changed the min version to 6.1.0 and redeploy operator, tidb log show logs like[2022/08/10 09:43:19.460 +00:00] [INFO] [http_handler.go:2186] ["update server labels"] [labels="{\"kubernetes.io/hostname\":\"kind-control-plane\",\"topology.kubernetes.io/zone\":\"test\",\"zone\":\"test\"}"]
That show labels had been set to tidb successfully.Side effects
Related changes
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.