Skip to content

CSI LinkedClone support #3351

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deepakkinni
Copy link
Collaborator

@deepakkinni deepakkinni commented Jun 21, 2025

What this PR does / why we need it:
Adds support for LinkedClone on Supervisor and Guest

Primary Changes in the driver are:

  1. CSI Webhook on Supervisor
  • Update the mutating webhook to add LinkedClone label if the LinkedClone annotation is present, this is necessary for UI
  • Prevent deletion of VolumeSnapshot if there LinkedClone was created from it
  • Add validations in webhook to prevent expanding a LinkedClone PVC
  • Add validations in webhook to prevent LinkedClone annotation modification
  1. PVCSI Webhook on Guest
  • Introduce mutating webhook
  • The mutating webhook adds LinkedClone label on PVC if it's a LinkedClone request
  • PVCSI webhook does validation similar to the extension service.
  1. Supervisor controller changes
  • Detect if the request is a LinkedClone PVC by reading the parameters populated by the custom external-provisioner
  • Updated CNSVolumeInfo to have a bool indicating if this is a LinkedClone
  • Update the VolumeSnapshot from which the LinkedClone was created by incrementing the linked clone ref count
  • Fail LinkedClone creation on FIleVolumes
  • On LinkedClone volume deletion, decrement the linked clone ref count on the VolumeSnapshot from which the LinkedClone was created
  • Same the volumesnapshot namespace and name in the volume attribute context, this shows up in the PV
  • This is used to find the VS on which we want to reduce the linked clone ref count
  1. Guest controller changes
  • Detect if LinkedClone from PVC annotation
  • Add LinkedClone label on PVC in guest
  • Determine topology requirement from the source PVC in supervisor
  1. Syncer changes
  • Update cnsvolumeinfo if the PVC is determined to be a LinkedClone
  1. General changes:
  • use dev version when calling linked clone

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Testing done:
Supervisor Testing
LinkedClone Supervisor Testing.log

Guest Testing
LinkedClone Guest Testing.log

Special notes for your reviewer:

Release note:

NONE

@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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 21, 2025
@k8s-ci-robot k8s-ci-robot requested a review from gnufied June 21, 2025 07:17
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepakkinni

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 requested a review from xing-yang June 21, 2025 07:17
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 21, 2025
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch from ae89329 to 017d2bc Compare June 24, 2025 07:34
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2025
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch 3 times, most recently from 91a7c12 to 7543609 Compare June 25, 2025 00:43
@deepakkinni deepakkinni changed the title [WIP] LinkedClone support CSI LinkedClone support Jun 25, 2025
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jun 25, 2025
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch from 7543609 to 203c358 Compare June 25, 2025 22:19
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 25, 2025
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch 2 times, most recently from d841688 to 336f425 Compare June 27, 2025 05:57
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 27, 2025
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch from 336f425 to f7bef67 Compare June 28, 2025 06:05
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 28, 2025
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch 5 times, most recently from 4319e83 to 1a04130 Compare July 2, 2025 00:34
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch 2 times, most recently from d7332a7 to ae2be81 Compare July 2, 2025 06:55
@@ -685,7 +687,7 @@ webhooks:
path: "/mutate"
rules:
- apiGroups: [""]
apiVersions: ["v1", "v1beta1"]
apiVersions: ["v1"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Check if "UPDATE" is necessary

Signed-off-by: Deepak Kinni <deepak.kinni@broadcom.com>
@deepakkinni deepakkinni force-pushed the topic/dk016388/lc_fss_v1 branch from ae2be81 to 2cfd416 Compare July 4, 2025 06:21
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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants