-
Notifications
You must be signed in to change notification settings - Fork 776
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
CloneSet supports to reuse PVC during upgrade #1881
base: master
Are you sure you want to change the base?
CloneSet supports to reuse PVC during upgrade #1881
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1881 +/- ##
==========================================
+ Coverage 47.91% 50.93% +3.02%
==========================================
Files 162 193 +31
Lines 23491 24979 +1488
==========================================
+ Hits 11256 12724 +1468
+ Misses 11014 10949 -65
- Partials 1221 1306 +85
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Siyu Wang <[email protected]>
7555224
to
e5011c4
Compare
) | ||
|
||
func IsSpecifiedDelete(obj metav1.Object) bool { | ||
_, ok := obj.GetLabels()[appsv1alpha1.SpecifiedDeleteKey] | ||
return ok | ||
} | ||
|
||
func PatchPodSpecifiedDelete(c client.Client, pod *v1.Pod, value string) (bool, error) { | ||
func ShouldKeepPVC(obj metav1.Object) bool { | ||
return obj.GetLabels()[appsv1alpha1.KeepPVCForDeletionKey] == "true" |
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.
is it necessary to introduce an extra label ? can we just checking the following logic?
!cs.Spec.ScaleStrategy.DisablePVCReuse && utilfeature.DefaultFeatureGate.Enabled(features.CloneSetPVCReuseDuringUpdate)
@FillZpp: PR needs rebase. 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 kubernetes/test-infra repository. |
Ⅰ. Describe what this PR does
CloneSet supports to reuse PVC during upgrade.
Newly added:
CloneSetPVCReuseDuringUpdate
feature-gate that enables CloneSet to reuse PVC during update.apps.kruise.io/keep-pvc-for-deletion
label that can either be used by the above feature, or user can directly set it in pod or pod template, so that CloneSet will keep the PVC to reuse when it deletes the pod.Ⅱ. Does this pull request fix one issue?
fixes #1876