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 VolumeHandle for dynamically provisioned VolumeGroupSnapshots #1198

Merged
merged 1 commit into from
Nov 20, 2024

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:

This patch sets the spec.source.volumeHandle field for
volume snapshot contents that are members of a dynamically provisioned volume
group snapshot, like a dynamically provisioned volume snapshot content would do.

The volume snapshot content logic has been improved to consider this case too.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

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

@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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Nov 19, 2024
@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 Nov 19, 2024
@leonardoce leonardoce changed the title Set VolumeHandle for dynamic provisioned VolumeGroupSnapshots Set VolumeHandle for dynamically provisioned VolumeGroupSnapshots Nov 19, 2024
@leonardoce leonardoce force-pushed the set-volumehandle branch 3 times, most recently from d992bd3 to a1be62e Compare November 19, 2024 16:52
@xing-yang
Copy link
Collaborator

Can you post your testing results that show VolumeSnapshot and VolumeSnapshotContent fields are set correctly?

@leonardoce
Copy link
Contributor Author

leonardoce commented Nov 19, 2024

Can you post your testing results that show VolumeSnapshot and VolumeSnapshotContent fields are set correctly?

Sure! And sorry for the wall of text.

- apiVersion: snapshot.storage.k8s.io/v1
  kind: VolumeSnapshot
  metadata:
    creationTimestamp: "2024-11-19T21:38:35Z"
    finalizers:
    - snapshot.storage.kubernetes.io/volumesnapshot-in-group-protection
    - snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection
    generation: 1
    labels:
      groupsnapshot.storage.k8s.io/volumeGroupSnapshotName: new-groupsnapshot-demo
    name: snapshot-55c8b8f7da1947b1257f455c99d7eb75c932e6146f9eeb467b5c28bf477b0339
    namespace: default
    resourceVersion: "2200178"
    uid: 9b8e0373-f4e7-45d8-a57b-ab14c8bb84b4
  spec:
    source:
      persistentVolumeClaimName: cluster-example-1
  status:
    boundVolumeSnapshotContentName: snapcontent-55c8b8f7da1947b1257f455c99d7eb75c932e6146f9eeb467b5c28bf477b0339
    creationTime: "2024-11-19T21:38:33Z"
    readyToUse: true
    restoreSize: 1Gi
    volumeGroupSnapshotName: new-groupsnapshot-demo
- apiVersion: snapshot.storage.k8s.io/v1
  kind: VolumeSnapshot
  metadata:
    creationTimestamp: "2024-11-19T21:38:35Z"
    finalizers:
    - snapshot.storage.kubernetes.io/volumesnapshot-in-group-protection
    - snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection
    generation: 1
    labels:
      groupsnapshot.storage.k8s.io/volumeGroupSnapshotName: new-groupsnapshot-demo
    name: snapshot-1aa1a114fcb059a99c472690a68a2519ad9518dcf6fc9ab47e019f72e915e4fe
    namespace: default
    resourceVersion: "2200191"
    uid: 35580211-b200-4ed1-a216-b819845e53bb
  spec:
    source:
      persistentVolumeClaimName: cluster-example-1-wal
  status:
    boundVolumeSnapshotContentName: snapcontent-1aa1a114fcb059a99c472690a68a2519ad9518dcf6fc9ab47e019f72e915e4fe
    creationTime: "2024-11-19T21:38:33Z"
    readyToUse: true
    restoreSize: 1Gi
    volumeGroupSnapshotName: new-groupsnapshot-demo
- apiVersion: snapshot.storage.k8s.io/v1
  kind: VolumeSnapshotContent
  metadata:
    creationTimestamp: "2024-11-19T21:38:35Z"
    finalizers:
    - snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection
    generation: 2
    labels:
      groupsnapshot.storage.k8s.io/volumeGroupSnapshotHandle: a017f002-a6be-11ef-a7b4-ae8ffed98ae4
    name: snapcontent-1aa1a114fcb059a99c472690a68a2519ad9518dcf6fc9ab47e019f72e915e4fe
    resourceVersion: "2200190"
    uid: 56ae7f8f-b8bf-456d-a8d6-3c36a4fa2930
  spec:
    deletionPolicy: Delete
    driver: hostpath.csi.k8s.io
    source:
      volumeHandle: 145063c3-a591-11ef-a409-4ebdfafda5f0
    sourceVolumeMode: Filesystem
    volumeSnapshotRef:
      kind: VolumeSnapshot
      name: snapshot-1aa1a114fcb059a99c472690a68a2519ad9518dcf6fc9ab47e019f72e915e4fe
      namespace: default
      uid: 35580211-b200-4ed1-a216-b819845e53bb
  status:
    creationTime: 1732052313169593437
    readyToUse: true
    restoreSize: 1073741824
    snapshotHandle: a083db7d-a6be-11ef-a7b4-ae8ffed98ae4
    volumeGroupSnapshotHandle: a017f002-a6be-11ef-a7b4-ae8ffed98ae4
- apiVersion: snapshot.storage.k8s.io/v1
  kind: VolumeSnapshotContent
  metadata:
    creationTimestamp: "2024-11-19T21:38:35Z"
    finalizers:
    - snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection
    generation: 2
    labels:
      groupsnapshot.storage.k8s.io/volumeGroupSnapshotHandle: a017f002-a6be-11ef-a7b4-ae8ffed98ae4
    name: snapcontent-55c8b8f7da1947b1257f455c99d7eb75c932e6146f9eeb467b5c28bf477b0339
    resourceVersion: "2200166"
    uid: 1b938a3a-85a7-4150-9540-1479591b4af7
  spec:
    deletionPolicy: Delete
    driver: hostpath.csi.k8s.io
    source:
      volumeHandle: 144f5adc-a591-11ef-a409-4ebdfafda5f0
    sourceVolumeMode: Filesystem
    volumeSnapshotRef:
      kind: VolumeSnapshot
      name: snapshot-55c8b8f7da1947b1257f455c99d7eb75c932e6146f9eeb467b5c28bf477b0339
      namespace: default
      uid: 9b8e0373-f4e7-45d8-a57b-ab14c8bb84b4
  status:
    creationTime: 1732052313169593437
    readyToUse: true
    restoreSize: 1073741824
    snapshotHandle: a017f350-a6be-11ef-a7b4-ae8ffed98ae4
    volumeGroupSnapshotHandle: a017f002-a6be-11ef-a7b4-ae8ffed98ae4

@leonardoce leonardoce force-pushed the set-volumehandle branch 2 times, most recently from 49b2edf to 556a842 Compare November 19, 2024 21:41
@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 Nov 20, 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 Nov 20, 2024
@k8s-ci-robot k8s-ci-robot merged commit d37087c into kubernetes-csi:master Nov 20, 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/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.

3 participants