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

tc level flag to enablePVCReplace feature (#5670) #5671

Closed ti-chi-bot closed 1 week ago

ti-chi-bot commented 1 week ago

This is an automated cherry-pick of #5670

What problem does this PR solve?

https://github.com/pingcap/tidb-operator/blob/9ef26f88bf75338cef427b44aa6303237ddcdbd6/pkg/features/features.go#L55C9-L57C44 PVC replace feature is currently enabled / disabled at tidb-operator level, which might not be comforting situation as a single tidb-operator can be handling multiple tidbclusters, so this PR enables tidbcluster level flag to enable / disable this feature. This is similar to another similar feature enablePVReclaim flag

What is changed and how does it work?

Added a new flag in CRD enablePVCReplace with a false as default value. If this flag is enabled then only tidb-operator would perform the PVC replacement process.

Code changes

Tests

Side effects

Related changes

Release Notes

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

ACTION REQUIRED: Introduces a new feature flag at a tidb-cluster level for enablePVCReplace, this works the same as VolumeReplacing but only enables specified tidb-cluster for VolumeReplacing. Enabling either the tidb-cluster level feature flag or the operator level feature flag will turn on this feature for a given tidb-cluster.
ti-chi-bot[bot] commented 1 week ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from csuzhangxc, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/pingcap/tidb-operator/blob/release-1.5/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment