-
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
Link PVCs and PVs in VolumeGroupSnapshot and VolumeGroupSnapshotContent #1069
Link PVCs and PVs in VolumeGroupSnapshot and VolumeGroupSnapshotContent #1069
Conversation
Hi @leonardoce. 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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
/assign |
Once successfully created, maybe remove the |
Yes. Nice idea, @nixpanic. All the information in that annotation is in the status section of both VolumeGroupSnapshot and VolumeGroupSnapshotStatus. But this would require a new API server call. More importantly, What's your opinion @xing-yang? |
Thinking aloud, the |
/hold |
I'd prefer the annotation gets removed. |
8cf3ea5
to
71ea1e2
Compare
I rebased it on the new master, removed the annotation, and updated the description of this PR with the latest resource definitions. |
Can you update the PR description? It still talks about the groupsnapshot.storage.kubernetes.io/info annotation. Can you also update the "Special notes for your reviewer" section? |
I see that the annotation is still in the code. Can you please squash the commits? It will be easier to see what code is removed this way. |
c69d79b
to
bb3b87a
Compare
You're correct, @xing-yang. I've another implementation that doesn't use annotation and queries the API server when needed. |
Yes, I'd prefer not to use the annotation. Thanks. |
bb3b87a
to
8dfe567
Compare
Done @xing-yang. Thank you. |
Name: volumeSnapshotContent.Spec.VolumeSnapshotRef.Name, | ||
}, | ||
PersistentVolumeClaimRef: v1.LocalObjectReference{ | ||
Name: pvcName, |
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.
If pv.Spec.ClaimRef is nil above, this will be an empty string?
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.
Yes, it will. And this is equivalent to an empty LocalObjectReference
.
And since the VolumeSnapshotRef
itself is marked as omitempty
, it will be omitted.
But I realized now that this is not evident from the code. Let me express it more clearly.
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.
Is it better now?
8dfe567
to
d37bf90
Compare
This use the update API to set `persistentVolumeClaimRef` in `VolumeGroupSnapshot` and `persistentVolumeName` in `VolumeGroupSnapshotContent` to the corresponding objects. This makes restoring volumes from a VolumeGroupSnapshot easier. Related: kubernetes-csi#969
d37bf90
to
3f8b79d
Compare
/lgtm |
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: leonardoce, sxd, 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?
What this PR does / why we need it:
Following #1068 and the discussion in #969, this PR improves the snapshot controller and the CSI snapshotter sidecar to track which PVC and PVs are snapshotted by a VolumeGroupSnapshot.
With this PR applied, a
VolumeGroupSnapshot
will look like:The corresponding
VolumeGroupSnapshotContent
will look like:Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Testing
To test this patch, I used the CSI host path driver.
Having two PVCs and creating a VolumeGroupSnapshot matching them is enough to trigger the process.
Does this PR introduce a user-facing change?: