-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
Add VolumeSnapshot retain policy test and test for snapshot delete #89705
Add VolumeSnapshot retain policy test and test for snapshot delete #89705
Conversation
/sig storage |
/assign @xing-yang |
0abffa2
to
69672dd
Compare
/test pull-kubernetes-e2e-kind-ipv6 |
We don't have a test for pre-provisioned snapshots. Just opened an issue for that: kubernetes-csi/external-snapshotter#285. For pre-provisioned snapshots, we also should have tests for both Delete and Retain policy. For pre-provisioned snapshots with Retain policy, we need this fix: kubernetes-csi/external-snapshotter#249. |
307b898
to
aa4fb28
Compare
Opened #92045 to track job timeouts |
@saikat-royc, ready for review. Seems like the remaining failing test is unrelated. |
/test pull-kubernetes-e2e-gce-storage-slow |
// The purpose of this block is to prevent physical snapshotContent leaks. | ||
// We must update the SnapshotContent to have Delete Deletion policy, | ||
// or else the physical snapshot content will be leaked. | ||
defer func() { |
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.
nit: This need not be a defer. A simple function call is sufficient here.
l.cleanupSteps = append(l.cleanupSteps, func() { | ||
framework.Logf("deleting SnapshotClass %s", l.vsc.GetName()) | ||
l.dc.Resource(SnapshotClassGVR).Delete(context.TODO(), l.vsc.GetName(), metav1.DeleteOptions{}) | ||
}) |
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.
Lets keep it uniform as to what is added in cleanupsteps and what is deferred within the function. This can be a simple defer similar to line 266 where the snapshot is getting deleted.
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.
To me it looks like cleanup steps mainly cleanup things setup in the common init() call. resources setup inside the TestSnapshottable and TestSnapshotDeleted can be deleted by a defer inside the functions.
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.
LGTM from my side after minor comments of defer are addressed.
31c6548
to
f22627e
Compare
Signed-off-by: Grant Griffiths <grant@portworx.com>
f22627e
to
e1f0e4c
Compare
Thanks! I just addressed the remaining PR feedback @saikat-royc |
/retest |
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.
Thanks for making the changes @ggriffiths. LGTM from my side.
/test pull-kubernetes-e2e-gce-storage-slow |
/lgtm |
/assign @msau42 |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ggriffiths, msau42 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 |
seems stuck on a test hook: |
Test failure unrelated, trying again. /test pull-kubernetes-node-e2e-containerd |
/retest |
@ggriffiths: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/retest Review the full test history for this PR. Silence the bot with an |
Signed-off-by: Grant Griffiths grant@portworx.com
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Adds tests for RetainPolicy and adds an additional delete check in the DeletePolicy test.
Which issue(s) this PR fixes:
Fixes kubernetes-csi/external-snapshotter#269
Special notes for your reviewer:
n/a
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
n/a