Skip to content

Conversation

@huffmanca
Copy link
Contributor

@huffmanca huffmanca commented Mar 13, 2020

What type of PR is this?
/kind flake

What this PR does / why we need it:
There were some instances where a namespace remained after a test due to a VolumeSnapshot persisted after the associated objects (VolumeSnapshotContent/PVC) and VolumeSnapshotClass had been deleted. If the cluster entered into this state, then the namespace would remain until the VolumeSnapshot was manually removed.

This PR allows a VolumeSnapshot that's been scheduled for deletion to be successfully deleted if the VolumeSnapshotClass cannot be found.

Which issue(s) this PR fixes:
N/A

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Allows the volume snapshot to be deleted if the volume snapshot class is not found.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/flake Categorizes issue or PR as related to a flaky test. labels Mar 13, 2020
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 13, 2020
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 13, 2020
@xing-yang
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 13, 2020
@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch 3 times, most recently from d751462 to 9745d48 Compare March 17, 2020 19:29
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 17, 2020
@huffmanca
Copy link
Contributor Author

@xing-yang - this should be ready for review

@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch from 9745d48 to 3bb0af2 Compare March 18, 2020 15:09
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 18, 2020
@huffmanca
Copy link
Contributor Author

I also removed the second commit and submitted it as a separate PR in #278 .

@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch from 3bb0af2 to e0cbed7 Compare March 18, 2020 17:41
@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch from e0cbed7 to 3ade34d Compare March 18, 2020 17:59
@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch 2 times, most recently from 43cafda to f91c359 Compare March 18, 2020 19:49
@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch from f91c359 to c88f93b Compare March 18, 2020 19:57
if err == nil || errors.IsNotFound(err) {
// We should still handle deletion events even if the VolumeSnapshotClass
// is not found in the cluster
klog.V(5).Infof("deleting snapshot %q ; snapshot has either been scheduled for deletion, or snapshotClass has already been removed", key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "snapshot has either been scheduled for deletion" can be removed as both condition will go thru "deleteSnapshot".
Suggest change to the following:
deleting snapshot %q; snapshotClass may have already been removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been updated to use the suggested message.

@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch from c88f93b to 4791370 Compare March 18, 2020 20:51
// If the VolumeSnapshotClass is not found, we still need to process an update
// so that syncSnapshot can delete the snapshot, should it still exist in the
// cluster after it's been removed from the informer cache
klog.V(5).Infof("passed checkAndUpdateSnapshotClass for snapshot %q, or snapshot needs to be deleted and snapshotClass doesn't exist", key)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest change to the following:
updating snapshot %q; snapshotClass may have already been removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been changed to use the suggested message.

@huffmanca huffmanca force-pushed the update_snapshotclass_deletion branch from 4791370 to 91a55c0 Compare March 18, 2020 20:55
@xing-yang
Copy link
Collaborator

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 19, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: huffmanca, xing-yang

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2020
@k8s-ci-robot k8s-ci-robot merged commit ac3ef99 into kubernetes-csi:master Mar 19, 2020
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 30, 2020
Aishwarya-Hebbar added a commit to Aishwarya-Hebbar/external-snapshotter that referenced this pull request Jul 7, 2025
74e066a82 Merge pull request kubernetes-csi#279 from Aishwarya-Hebbar/update-csi-prow-version
6f236be7d Update CSI prow driver version to v1.17.0
0ee55894b Merge pull request kubernetes-csi#280 from xing-yang/update_go_1.24.4
9af101534 update to go 1.24.4
f5fec3e36 Merge pull request kubernetes-csi#275 from chrishenzie/emeritus
c5d285db8 Remove chrishenzie from kubernetes-csi-reviewers
0a435bf98 Merge pull request kubernetes-csi#274 from andyzhangx/patch-5
cd7b4bba3 Bump golang to 1.24.2 to fix CVE-2025-22871
701dc34bc Merge pull request kubernetes-csi#273 from andyzhangx/patch-4
aeebd30e8 Bump golang to 1.24.0
f277d561f Merge pull request kubernetes-csi#270 from carlory/update-kind-version
6dcb96a51 update default kind version to v0.25.0

git-subtree-dir: release-tools
git-subtree-split: 74e066a82d2ea14a68ff37f0e02ddc34619bbccd
Aishwarya-Hebbar added a commit to Aishwarya-Hebbar/external-snapshotter that referenced this pull request Jul 8, 2025
74e066a82 Merge pull request kubernetes-csi#279 from Aishwarya-Hebbar/update-csi-prow-version
6f236be7d Update CSI prow driver version to v1.17.0
0ee55894b Merge pull request kubernetes-csi#280 from xing-yang/update_go_1.24.4
9af101534 update to go 1.24.4
f5fec3e36 Merge pull request kubernetes-csi#275 from chrishenzie/emeritus
c5d285db8 Remove chrishenzie from kubernetes-csi-reviewers
0a435bf98 Merge pull request kubernetes-csi#274 from andyzhangx/patch-5
cd7b4bba3 Bump golang to 1.24.2 to fix CVE-2025-22871
701dc34bc Merge pull request kubernetes-csi#273 from andyzhangx/patch-4
aeebd30e8 Bump golang to 1.24.0
f277d561f Merge pull request kubernetes-csi#270 from carlory/update-kind-version
6dcb96a51 update default kind version to v0.25.0

git-subtree-dir: release-tools
git-subtree-split: 74e066a82d2ea14a68ff37f0e02ddc34619bbccd
dobsonj added a commit to dobsonj/external-snapshotter that referenced this pull request Sep 4, 2025
5f38a9075 Merge pull request kubernetes-csi#282 from rhrmo/update-go-1.24.6
579f62421 Update go to 1.24.6
74e066a82 Merge pull request kubernetes-csi#279 from Aishwarya-Hebbar/update-csi-prow-version
6f236be7d Update CSI prow driver version to v1.17.0
0ee55894b Merge pull request kubernetes-csi#280 from xing-yang/update_go_1.24.4
9af101534 update to go 1.24.4
f5fec3e36 Merge pull request kubernetes-csi#275 from chrishenzie/emeritus
c5d285db8 Remove chrishenzie from kubernetes-csi-reviewers

git-subtree-dir: release-tools
git-subtree-split: 5f38a907597230563f5e2213aea116acdd9d86bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants