-
Notifications
You must be signed in to change notification settings - Fork 385
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
Dont call DeleteSnapshot when VS belong to VGS #1231
Conversation
/hold for testing |
Driver
|
/hold cancel |
/assign @xing-yang @jsafrane |
@@ -61,7 +61,7 @@ func (ctrl *csiSnapshotSideCarController) syncContent(content *crdv1.VolumeSnaps | |||
if ctrl.shouldDelete(content) { | |||
klog.V(4).Infof("VolumeSnapshotContent[%s]: the policy is %s", content.Name, content.Spec.DeletionPolicy) | |||
if content.Spec.DeletionPolicy == crdv1.VolumeSnapshotContentDelete && | |||
content.Status != nil && content.Status.SnapshotHandle != nil { | |||
content.Status != nil && content.Status.SnapshotHandle != nil && content.Status.VolumeGroupSnapshotHandle == nil { |
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.
does this need some tests?
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.
added extra test case to ensure no RPC call is made when VolumeGroupSnapshotHandle
is set on the content
edf77b6
to
fd45362
Compare
Dont call the DeleteSnapshot RPC call when a snapshot is created as part of the VolumeGroupSnapshot.
for _, c := range content { | ||
c.Status.VolumeGroupSnapshotHandle = &volumeGroupSnapshotHandle | ||
} | ||
return content |
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: I personally do not like functions that take this many parmaeters. There are better ways of doing this. Such as - using the builder pattern or using parameter types.
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.
@gnufied Yes i agree that this is going to make the life harder (read/maintain) but that required more work outside the scope of this PR as lot of cleanup is required in this file, is it accepted to do this cleanup as a followup?
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.
Can you file an issue for this?
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.
filed one here #1232
/lgtm |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Madhu-1, 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Dont call the DeleteSnapshot RPC call when a snapshot is created as part of the VolumeGroupSnapshot.
Which issue(s) this PR fixes:
Fixes #1230
Special notes for your reviewer:
Does this PR introduce a user-facing change?: