Skip to content

Conversation

leonardoce
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug

/kind cleanup

/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

Addresses API review comments in #1312

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Several VolumeGroupSnapshot, VolumeGroupSnapshotClass and VolumeGroupSnapshotContent fields are now immutable. The `v1beta1` VolumeGroupSnapshot API is now marked as deprecated.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 7, 2025
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Oct 7, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 7, 2025
@leonardoce leonardoce changed the title Address API review comments Deprecate VolumeGroupSnapshot v1beta1, address API review comments Oct 7, 2025
@leonardoce leonardoce marked this pull request as ready for review October 7, 2025 15:28
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 7, 2025
@k8s-ci-robot k8s-ci-robot requested a review from pohly October 7, 2025 15:28
@leonardoce
Copy link
Contributor Author

/assign @xing-yang

Signed-off-by: Leonardo Cecchi <[email protected]>
@xing-yang
Copy link
Collaborator

/assign @msau42

@xing-yang
Copy link
Collaborator

For VolumeGroupSnapshotRef in VolumeGroupSnapshotContentSpec, we can't make VolumeGroupSnapshotRef itself immutable because name and namespace are set by the admin and UID is set by the controller for static provisioning.
Can we add rule to make sure name, namespace, or UID is immutable once set?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: leonardoce
Once this PR has been reviewed and has the lgtm label, please ask for approval from msau42. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@leonardoce
Copy link
Contributor Author

For VolumeGroupSnapshotRef in VolumeGroupSnapshotContentSpec, we can't make VolumeGroupSnapshotRef itself immutable because name and namespace are set by the admin and UID is set by the controller for static provisioning. Can we add rule to make sure name, namespace, or UID is immutable once set?

I added a CEL rule for that.

// "Delete" means that the VolumeGroupSnapshotContent and its physical group
// snapshot on underlying storage system are deleted.
// Required.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="deletionPolicy is immutable once set"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do allow users to change the deletion policy for SC.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we allow that? I didn't know we can modify SC at all.
I thought it is the ReclaimPolicy in PV that we can change.

// VolumeGroupSnapshot and VolumeGroupSnapshotContent objects is successful
// (by validating that both VolumeGroupSnapshot and VolumeGroupSnapshotContent
// point at each other) before using this object.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="boundVolumeGroupSnapshotContentName is immutable once set"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually sure, but does this handle the scenario where we need to set it the first time?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, it is immutable after it is set.

@msau42
Copy link
Collaborator

msau42 commented Oct 14, 2025

Do we have tests running for the groupsnapshot functionality?

@xing-yang
Copy link
Collaborator

Do we have tests running for the groupsnapshot functionality?

Yes, we added e2e test before moving group snapshot to v1beta1.

@xing-yang
Copy link
Collaborator

@leonardoce can you add cel tests for changes you made in this PR? https://github.com/kubernetes-csi/external-snapshotter/tree/master/client/hack/cel-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants