-
Notifications
You must be signed in to change notification settings - Fork 394
Fix PVC finalizer not removed due to broken VolumeSnapshots #1306
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
base: release-6.3
Are you sure you want to change the base?
Fix PVC finalizer not removed due to broken VolumeSnapshots #1306
Conversation
When VolumeSnapshots referencing a PVC are stuck in a non-ready state (e.g., due to a misconfigured VolumeSnapshotClass), the PVC finalizer \`pvc-as-source-protection\` is never removed, preventing PVC deletion. This patch ensures that only VolumeSnapshots that are: - not ReadyToUse - and still own the PVC finalizer are considered \"in-use\" by the snapshot controller. This prevents invalid or broken snapshots from blocking PVC deletion. Signed-off-by: Vasu Mahalingam <[email protected]>
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: vasumahalingam-nutanix The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Welcome @vasumahalingam-nutanix! |
Hi @vasumahalingam-nutanix. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
What type of PR is this?
What this PR does / why we need it:
Fixes a bug where a PVC’s finalizer
snapshot.storage.kubernetes.io/pvc-as-source-protection
is not removed when there are broken or misconfigured VolumeSnapshots that reference the PVC but never transition toReadyToUse
.The snapshot controller currently considers any VolumeSnapshot with
ReadyToUse == false
as blocking PVC deletion — even if the snapshot is invalid and has already failed.This patch ensures the controller only considers:
ReadyToUse == false
, andpvc-as-source-protection
finalizerThis avoids permanently stuck PVCs when broken snapshots linger in the namespace.
Which issue(s) this PR fixes:
Fixes #1305
Special notes for your reviewer:
Does this PR introduce a user-facing change?: