karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.14k stars 812 forks source link

Introduced flag to specify when sts deleted, pvc's behavious #4759

Open CharlesQQ opened 1 month ago

CharlesQQ commented 1 month ago

What type of PR is this?

/kind bug

What this PR does / why we need it: Introduced flag to specify when sts deleted, pvc's behavious

Which issue(s) this PR fixes: Fixes https://github.com/karmada-io/karmada/issues/4750

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


`karmadactl`/`kubectl-karmada`: Introduced `etcd-sts-pvc-delete-policy` flags to specify when sts deleted, pvc's behavious
karmada-bot commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign prodanlabs after the PR has been reviewed. You can assign the PR to them by writing /assign @prodanlabs in a comment when ready.

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

Needs approval from an approver in each of these files: - **[pkg/karmadactl/cmdinit/OWNERS](https://github.com/karmada-io/karmada/blob/master/pkg/karmadactl/cmdinit/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 51.78%. Comparing base (13dafc6) to head (e5f0662). Report is 23 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4759 +/- ## ========================================== - Coverage 51.81% 51.78% -0.03% ========================================== Files 250 250 Lines 24983 24991 +8 ========================================== - Hits 12944 12942 -2 - Misses 11330 11340 +10 Partials 709 709 ``` | [Flag](https://app.codecov.io/gh/karmada-io/karmada/pull/4759/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/karmada-io/karmada/pull/4759/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | `51.78% <100.00%> (-0.03%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

XiShanYongYe-Chang commented 1 month ago

What should we do with these flags for Kubernetes versions prior to v1.26?

CharlesQQ commented 1 month ago

What should we do with these flags for Kubernetes versions prior to v1.26?

patch ovnerreference to pvc metedata

XiShanYongYe-Chang commented 1 month ago

patch ovnerreference to pvc metedata

Sorry, let me rephrase my question. If the version of karmada-apiserver is before 1.27, will the current change have no effect or will it cause the etcd statefulset to report an error?

CharlesQQ commented 1 month ago

If the version of karmada-apiserver is before 1.27, will the current change have no effect or will it cause the etcd statefulset to report an error?

sts has no field spec.persistentVolumeClaimRetentionPolicy, so sts can't be created and report an error

XiShanYongYe-Chang commented 1 month ago

This behavior may not be expected as we allow the user to set the version of the apiserver:

https://github.com/karmada-io/karmada/blob/456d099404d09ba4094614a6a3a8bea36cdf6d61/pkg/karmadactl/cmdinit/cmdinit.go#L121

We may need to add some judgment logic.