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

GetVolumeGroupSnapshot should check SnapshotIDs not SourceVolumeIDs #494

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

nixpanic
Copy link
Contributor

@nixpanic nixpanic commented Jan 19, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Due to this bug in GetVolumeGroupSnapshot, creating pre-provisioned
VolumeGroupSnapshots was not working. Pre-provisioned
VolumeGroupSnapshots refer to a list of SnapshotIDs that are part of the
VolumeGroupSnapshot, the SourceVolumeIDs are not used in that case.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Tested with kubernetes-csi/external-snapshotter#837

Does this PR introduce a user-facing change?:

Fix an issue with GetVolumeGroupSnapshot where SourceVolumeIDs were compared with SnapshotIDs.

Due to this bug in GetVolumeGroupSnapshot, creating pre-provisioned
VolumeGroupSnapshots was not working. Pre-provisioned
VolumeGroupSnapshots refer to a list of SnapshotIDs that are part of the
VolumeGroupSnapshot, the SourceVolumeIDs are not used in that case.
@k8s-ci-robot k8s-ci-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Jan 19, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 19, 2024
@nixpanic nixpanic changed the title GetVolumeGroupSnapshot should check SnapshoIDs not SourceVolumeIDs GetVolumeGroupSnapshot should check SnapshotIDs not SourceVolumeIDs Jan 19, 2024
@nixpanic
Copy link
Contributor Author

nixpanic commented Jan 19, 2024

Tested manually with YAML like:

---
apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshotContent
metadata:
  name: manual-vgs-content
spec:
  deletionPolicy: Retain
  driver: hostpath.csi.k8s.io
  volumeGroupSnapshotRef:
    apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
    kind: VolumeGroupSnapshot
    name: manual-vgs
    namespace: default
  volumeGroupSnapshotClassName: csi-hostpath-vgsc
  source:
    groupSnapshotHandles:
      volumeGroupSnapshotHandle: ef357b04-b6d2-11ee-b9e8-0a580a8003c1
      volumeSnapshotHandles:
        - ef357b49-b6d2-11ee-b9e8-0a580a8003c1

Replace volumeGroupSnapshotHandle and volumeSnapshotHandles with appropriate values.

$ kubectl get VolumeGroupSnapshotContent/manual-vgs-content -oyaml
apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
kind: VolumeGroupSnapshotContent
metadata:
  creationTimestamp: "2024-01-19T18:58:42Z"
  generation: 1
  name: manual-vgs-content
  resourceVersion: "6411444"
  uid: 1da5ef37-1104-49a0-b44d-70e8eb4b65b1
spec:
  deletionPolicy: Retain
  driver: hostpath.csi.k8s.io
  source:
    groupSnapshotHandles:
      volumeGroupSnapshotHandle: ef357b04-b6d2-11ee-b9e8-0a580a8003c1
      volumeSnapshotHandles:
      - ef357b49-b6d2-11ee-b9e8-0a580a8003c1
  volumeGroupSnapshotClassName: csi-hostpath-vgsc
  volumeGroupSnapshotRef:
    apiVersion: groupsnapshot.storage.k8s.io/v1alpha1
    kind: VolumeGroupSnapshot
    name: manual-vgs
    namespace: default
status:
  creationTime: 1705672756771101019
  readyToUse: true
  volumeGroupSnapshotHandle: ef357b04-b6d2-11ee-b9e8-0a580a8003c1

@nixpanic
Copy link
Contributor Author

/retest

@xing-yang
Copy link
Contributor

@nixpanic Can you test this PR with the latest changes in external-snapshotter?

@nixpanic
Copy link
Contributor Author

@nixpanic Can you test this PR with the latest changes in external-snapshotter?

@xing-yang I used a build of the csi-driver-hostpath that included this PR to test kubernetes-csi/external-snapshotter#837 and kubernetes-csi/external-snapshotter#995. Is there an other change that you would like to see tested?

@xing-yang
Copy link
Contributor

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nixpanic, 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 Feb 7, 2024
@k8s-ci-robot k8s-ci-robot merged commit 541ea8c into kubernetes-csi:master Feb 7, 2024
10 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. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants