-
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
Set PVC name on VolumeGroupSnapshot members #1177
Conversation
Skipping CI for Draft Pull Request. |
01013e0
to
f2fe3d4
Compare
LGTM, @xing-yang can you please review this PR? |
This patch sets the `spec.persistentVolumeClaimName` field for volume snapshots that are member of a dynamically provisioned volume group snapshot, like a dynamically provisioned volume snapshot would do. The volume snapshot logic has been improved to skip the creation of relative snapshot as it has already been created by the group snapshot.
f2fe3d4
to
811740c
Compare
@@ -621,7 +621,7 @@ func (ctrl *csiSnapshotCommonController) createSnapshotsForGroupSnapshotContent( | |||
"createSnapshotsForGroupSnapshotContent: creating volumesnapshotcontent %w", err) | |||
} | |||
|
|||
_, err = ctrl.clientset.SnapshotV1().VolumeSnapshots(volumeSnapshotNamespace).Create(ctx, volumeSnapshot, metav1.CreateOptions{}) | |||
createdVolumeSnapshot, err := ctrl.clientset.SnapshotV1().VolumeSnapshots(volumeSnapshotNamespace).Create(ctx, volumeSnapshot, metav1.CreateOptions{}) |
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.
At this point, the VolumeSnapshotContents already exist. Can you set status.boundVolumeSnapshotContentName
here?
(I don't remember if it's possible to create instances with status directly).
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 would have loved to do that.
Unfortunately it is not possible. That's why I'm forced to hit the API server two times.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, leonardoce 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 |
@leonardoce were you able to test creating Volumegroupsnapshot with your changes? |
Yes. I tested this with the csi hostpath privisioner. Boh dynamic and static provisioning |
What type of PR is this?
What this PR does / why we need it:
This patch sets the
spec.persistentVolumeClaimName
field forvolume snapshots that are members of a dynamically provisioned volume
group snapshot, like a dynamically provisioned volume snapshot would do.
The volume snapshot logic has been improved to skip the creation of
relative snapshot as it has already been created by the group snapshot.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: