pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.2k stars 490 forks source link

Record owner's generation into STS's annotation #5647

Closed ideascf closed 1 month ago

ideascf commented 1 month ago

What problem does this PR solve?

Currently, we have no ability to check whether the STS is already updated with the latest TC.spec.{component}. But for some scenarios, we want to know whether is a STS successfully updated. Therefore, this PR introduces a new annotation tidb.pingcap.com/owner-generation to store the generation of its owner into STS's annotation.

What is changed and how does it work?

Code changes

Tests

k get tc -oyaml | grep generation
    generation: 31

get asts db-tidb -oyaml | grep owner-generation
    tidb.pingcap.com/owner-generation: "31"

Side effects

Related changes

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.

ti-chi-bot[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: csuzhangxc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/pingcap/tidb-operator/blob/master/OWNERS)~~ [csuzhangxc] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ti-chi-bot[bot] commented 1 month ago

[LGTM Timeline notifier]

Timeline:

csuzhangxc commented 1 month ago

/run-all-tests

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 30.57%. Comparing base (3897095) to head (cfb9dc2). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5647 +/- ## =========================================== - Coverage 61.46% 30.57% -30.90% =========================================== Files 235 219 -16 Lines 30397 30312 -85 =========================================== - Hits 18683 9267 -9416 - Misses 9840 19759 +9919 + Partials 1874 1286 -588 ``` | [Flag](https://app.codecov.io/gh/pingcap/tidb-operator/pull/5647/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | Coverage Δ | | |---|---|---| | [e2e](https://app.codecov.io/gh/pingcap/tidb-operator/pull/5647/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `30.57% <50.00%> (?)` | | | [unittest](https://app.codecov.io/gh/pingcap/tidb-operator/pull/5647/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pingcap) | `?` | |
csuzhangxc commented 1 month ago

/run-pull-e2e-kind-across-kubernetes

csuzhangxc commented 1 month ago

/run-pull-e2e-kind-basic

csuzhangxc commented 1 month ago

/run-pull-e2e-kind-br

csuzhangxc commented 1 month ago

/run-pull-e2e-kind-serial