Skip to content
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

Use ownership to identify volume group snapshot members #1225

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

leonardoce
Copy link
Contributor

Instead of marking the member snapshot object with a label, this PR uses an ownership reference.

Member objects are looked up using a new index in the informer cache.

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:

This PR removes the usage of the groupsnapshot.storage.k8s.io/volumeGroupSnapshotName label, opting for an ownership-based volume group snapshot member tracking as described in the relative comment.

The patch fixes an issue in the csi-snapshotter sidecar that was failing to pass the snapshot ids to the DeleteGroupSnapshot RPC endpoint for statically provisioned snapshots with the Delete retention policy.

Which issue(s) this PR fixes:

Fixes #1213

Special notes for your reviewer:

With this PR applied, my smoke tests are passing.
They cover volume group snapshots (static and dynamic provisioning, both retain and delete deletion policy) and volume snapshots (static and dynamic provisioning, both retain and delete deletion policy).

I manually tested creating a volume group snapshot with a name of 73 characters and everything went fine.

Does this PR introduce a user-facing change?:

The  `groupsnapshot.storage.k8s.io/volumeGroupSnapshotName` label is not used anymore for dynamically provisioned volume group snapshot members. The members of a volume group snapshot can be identified as being owned by the VolumeGroupSnapshot.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 1, 2024
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 1, 2024
@leonardoce
Copy link
Contributor Author

/assign xing-yang

pkg/common-controller/snapshot_controller.go Outdated Show resolved Hide resolved
pkg/utils/vgs.go Outdated Show resolved Hide resolved
pkg/utils/vgs.go Outdated Show resolved Hide resolved
pkg/utils/vgs.go Outdated Show resolved Hide resolved
pkg/common-controller/snapshot_controller.go Outdated Show resolved Hide resolved
pkg/utils/vgs.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 2, 2024
@Madhu-1
Copy link
Contributor

Madhu-1 commented Dec 2, 2024

/assign @xing-yang

pkg/utils/vgs.go Outdated Show resolved Hide resolved
Instead of marking the member snapshot object with a label, this PR uses
an ownership reference.

Member objects are looked up using a new index in the informer cache.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 2, 2024
@xing-yang
Copy link
Collaborator

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 2, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leonardoce, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 2, 2024
@k8s-ci-robot k8s-ci-robot merged commit b5e06f5 into kubernetes-csi:master Dec 2, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing group name label from VolumeSnapshots that are part of a statically provisioned group snapshot
4 participants