-
Notifications
You must be signed in to change notification settings - Fork 370
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 snapshot size to VSC created for VGS #1011
Conversation
Hi @Madhu-1. 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. |
/assign @xing-yang |
@@ -446,7 +446,7 @@ func (ctrl *csiSnapshotSideCarController) updateSnapshotContentStatus( | |||
SnapshotHandle: &snapshotHandle, | |||
ReadyToUse: &readyToUse, | |||
CreationTime: &createdAt, | |||
RestoreSize: &size, | |||
RestoreSize: size, |
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 wonder if all the pointers to size int64
is really needed. size == 0
already indicates that the value is optional from a CSI Spec point of view:
// Information about a specific snapshot.
message Snapshot {
// This is the complete size of the snapshot in bytes. The purpose of
// this field is to give CO guidance on how much space is needed to
// create a volume from this snapshot. The size of the volume MUST NOT
// be less than the size of the source snapshot. This field is
// OPTIONAL. If this field is not set, it indicates that this size is
// unknown. The value of this field MUST NOT be negative and a size of
// zero means it is unspecified.
int64 size_bytes = 1;
This indicates an existing bug when RestoreSize: 0
is set. It should probably never be set to 0 at all.
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.
that also works, remove the pointer and added size >0
check
9382f1a
to
f2e4270
Compare
Looks reasonable to me. Can you confirm it addresses issue #1002 ? /ok-to-test |
Currently the RestoreSize is missing when the corresponding VSC are created for the the volumesnapshotgroup, This PR adds the missing RestoreSize for VSC. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
f2e4270
to
5a7115d
Compare
below is the volumesnapshotcontent after the fix, i can see [$]kubectl get volumesnapshotcontent snapcontent-e67b491e059be31f49753afffe159d8a9952b7039027558fe7fb4fd7fedec218-2024-02-14-2.37.11 -oyaml
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotContent
metadata:
creationTimestamp: "2024-02-14T14:37:11Z"
finalizers:
- snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection
generation: 2
name: snapcontent-e67b491e059be31f49753afffe159d8a9952b7039027558fe7fb4fd7fedec218-2024-02-14-2.37.11
resourceVersion: "275842"
uid: 7b365bcd-741c-4a26-94e9-972826dec2c7
spec:
deletionPolicy: Delete
driver: rook-ceph.cephfs.csi.ceph.com
source:
snapshotHandle: 0001-0009-rook-ceph-0000000000000001-1a14a2e3-6bbe-48d2-8b48-f47d4a7a1cab
volumeSnapshotRef:
kind: VolumeSnapshots
name: snapshot-e67b491e059be31f49753afffe159d8a9952b7039027558fe7fb4fd7fedec218-2024-02-14-2.37.11
namespace: default
uid: a7fb44af-6137-4801-b132-ad12b9464506
status:
creationTime: 1707921431731229233
readyToUse: true
restoreSize: 1073741824
snapshotHandle: 0001-0009-rook-ceph-0000000000000001-1a14a2e3-6bbe-48d2-8b48-f47d4a7a1cab
volumeGroupSnapshotHandle: 0001-0009-rook-ceph-0000000000000001-b76b4108-7d72-404c-aad0-e23e1fc2ac8b |
/lgtm |
/kind bug |
Can you add a release note? |
@xing-yang updated the release notes, can you please check and let me know if there is any other suggestion on it. |
/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 |
Currently the RestoreSize is missing when the corresponding VSC are created for the the volumesnapshotgroup, This PR adds the missing RestoreSize for VSC.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1002
Special notes for your reviewer:
Does this PR introduce a user-facing change?: