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

Set PVC name on VolumeGroupSnapshot members #1177

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

leonardoce
Copy link
Contributor

@leonardoce leonardoce commented Oct 29, 2024

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 patch sets the spec.persistentVolumeClaimName field for
volume 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?:

The "spec.persistentVolumeClaimName" field is now set on VolumeSnapshots that are members of a dynamically provisioned VolumeGroupSnapshot. This is consistent with dynamically provisioned VolumeSnapshots.

@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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. labels Oct 29, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 6, 2024
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 6, 2024
@leonardoce leonardoce marked this pull request as ready for review November 6, 2024 10:20
@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 Nov 6, 2024
@yati1998
Copy link
Contributor

yati1998 commented Nov 6, 2024

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.
@@ -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{})
Copy link
Contributor

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).

Copy link
Contributor Author

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.

@jsafrane
Copy link
Contributor

jsafrane commented Nov 7, 2024

/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 Nov 7, 2024
@k8s-ci-robot
Copy link
Contributor

[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 /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 Nov 7, 2024
@k8s-ci-robot k8s-ci-robot merged commit ab40e9d into kubernetes-csi:master Nov 7, 2024
8 checks passed
@yati1998
Copy link
Contributor

@leonardoce were you able to test creating Volumegroupsnapshot with your changes?

@leonardoce
Copy link
Contributor Author

Yes. I tested this with the csi hostpath privisioner. Boh dynamic and static provisioning

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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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/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.

5 participants