-
Notifications
You must be signed in to change notification settings - Fork 374
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
DeleteVolumeGroupSnapshot API - part 2 #952
DeleteVolumeGroupSnapshot API - part 2 #952
Conversation
5f809cc
to
7797aa7
Compare
/assign @xing-yang |
cmd/snapshot-controller/main.go
Outdated
@@ -72,8 +72,7 @@ var ( | |||
retryIntervalMax = flag.Duration("retry-interval-max", 5*time.Minute, "Maximum retry interval of failed volume snapshot creation or deletion. Default is 5 minutes.") | |||
enableDistributedSnapshotting = flag.Bool("enable-distributed-snapshotting", false, "Enables each node to handle snapshotting for the local volumes created on that node") | |||
preventVolumeModeConversion = flag.Bool("prevent-volume-mode-conversion", false, "Prevents an unauthorised user from modifying the volume mode when creating a PVC from an existing VolumeSnapshot.") | |||
// TODO(xing-yang): Enable enableVolumeGroupSnapshots when the feature is fully implemented | |||
// enableVolumeGroupSnapshots = flag.Bool("enable-volume-group-snapshots", false, "Enables the volume group snapshot feature, allowing the user to create snapshots of groups of volumes.") | |||
enableVolumeGroupSnapshots = flag.Bool("enable-volume-group-snapshots", false, "Enables the volume group snapshot feature, allowing the user to create snapshots of groups of volumes.") |
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.
create snapshots of groups of volumes -> create a snapshot of a group of volumes
if err == nil { | ||
msg := fmt.Sprintf("failed to delete snapshot API %s object as it belongs to group snapshot %s", utils.SnapshotKey(snapshot), utils.GroupSnapshotKey(groupSnapshot)) | ||
ctrl.eventRecorder.Event(snapshot, v1.EventTypeWarning, "SnapshotDeleteError", msg) | ||
return fmt.Errorf(msg) |
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.
I think we either need to add a webhook to prevent the deletion from happening in the first place or add a finalizer. I'm fine to add that in a followup PR. Can you add a note in your PR description?
failed to delete snapshot API %s object as it belongs to group snapshot %s -> deletion of the individual volume snapshot %s is not allowed as it belongs to group snapshot %s. Delete the group snapshot will trigger the deletion of all the individual volume snapshots that are part of the group.
Also add an error msg.
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.
Amongst the other changes I had a tough time testing out the finaliser code, so I removed it. I can address that in a follow up PR. We definitely need some logic in case the web hook is not deployed. I'll change the PR description.
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.
Sure. Yes, finalizer is better as the webhook may not be deployed.
Hi! I was just thinking that we could include the update of the dependencies in a separate PR. |
Thanks @leonardoce for the review comments. @RaunakShah Can you please split the client side changes into a separate PR? Thanks. |
12c9f11
to
8a9f7e7
Compare
8a9f7e7
to
ad67ef3
Compare
Can you please squash the commits and rebase to get the latest Trivy fix? |
71266eb
to
c5a433b
Compare
708674a
to
060ee23
Compare
…te API and prevent users from deleting individual volume snapshots if it is part of an existing group snapshot Also revert commit bb29899.
@xing-yang Done! |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RaunakShah, 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 feature
What this PR does / why we need it:
This PR is a follow up to #882
This PR also reverts de93167
There will be a follow up PR dedicated to adding a finaliser to volume snapshot objects that are part of the group, as well as some logic in the web hook to disallow individual volume snapshot deletion as long as the group snapshot exists
Testing
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: