-
Notifications
You must be signed in to change notification settings - Fork 382
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
Check for non-CSI PVs and mark not in use as appropriate #354
Conversation
Hi @huffmanca. 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/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: huffmanca 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 |
76198b2
to
a40e440
Compare
a40e440
to
9722d39
Compare
This approach (checking to see if the backing volume is CSI before adding the finalizer to the PVC) has worked when I've manually tested it. The VolumeSnapshot can be deleted, as the PVC doesn't have the finalizer when the snapshot is scheduled for deletion. |
@@ -819,8 +819,17 @@ func (ctrl *csiSnapshotCommonController) ensurePVCFinalizer(snapshot *crdv1.Volu | |||
return newControllerUpdateError(pvc.Name, "cannot add finalizer on claim because it is being deleted") | |||
} | |||
|
|||
// Check to see if the backing PV is created by a CSI driver. If not, then remove the Finalizer, | |||
// as the snapshot can't be created from this PVC | |||
pv, err := ctrl.getVolumeFromVolumeSnapshot(snapshot) |
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.
This could fail for other reasons. This method does not really check if PV is backed by a CSI driver.
I have submitted this PR #360 for the finalizer deletion problem. Can you give a try? For the problem that you reported, I think we should check early and fail early. After the call to checkAndUpdateSnapshotClass in common-controller/snapshot_controller_base.go, we can add a small function with the following steps:
|
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently, if you specify a PVC and that PVC was created by an in-tree driver we never create the content and cannot delete the snapshot, as the source finalizer is never removed.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: