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

Upgrade ramen to latest snapshotter crd and enforce VGS name length limit #1554

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

BenamarMk
Copy link
Member

@BenamarMk BenamarMk commented Sep 12, 2024

This PR includes the following updates:

  1. Update Ramen to use latest CRD from external-snapshotter
  • Integrated the latest CRD from external-snapshotter.
  • Updated dependencies and relevant configuration files.
  • Changed VolumeSnapshotRefList in VolumeGroupSnapshotStatus to PVCVolumeSnapshotRefList, which allows to map a VolumeSnapshot to the application PVC.
  1. Ensure VolumeGroupSnapshot name contains at most 63 characters:
  • Added validation to ensure that the VolumeGroupSnapshot (VGS) name complies with the Kubernetes resource name limit of 63 characters.

Fixes: 2311790

@BenamarMk BenamarMk force-pushed the upgrade-ramen-to-latest-snapshotter-crd branch from a3756dd to c83cf3f Compare September 12, 2024 14:31
@BenamarMk BenamarMk changed the title Upgrade ramen to latest snapshotter crd Upgrade ramen to latest snapshotter crd and enforce VGS name length limit Sep 12, 2024
Benamar Mekhissi added 3 commits September 14, 2024 04:48
- Integrated the latest CRD from external-snapshotter.
- Updated dependencies and relevant configuration files.
- Changed VolumeSnapshotRefList in VolumeGroupSnapshotStatus to PVCVolumeSnapshotRefList,
which allows to map a VolumeSnapshot to the application PVC.

Signed-off-by: Benamar Mekhissi <[email protected]>
This is mainly to ensure that the VRG on the primary and secondary are in sync
in regards to labels and annotations

Signed-off-by: Benamar Mekhissi <[email protected]>
@BenamarMk BenamarMk force-pushed the upgrade-ramen-to-latest-snapshotter-crd branch from 54520e5 to 24650ae Compare September 14, 2024 11:29
@@ -92,4 +91,4 @@ spec:
type: object
served: true
storage: true
subresources: {}
Copy link
Member

Choose a reason for hiding this comment

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

@BenamarMk , this file is not actually changed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, thanks. I'll remove it.

@@ -285,13 +292,13 @@ func (h *volumeGroupSourceHandler) RestoreVolumesFromSnapshot(

volumeSnapshot := &vsv1.VolumeSnapshot{}
if err := h.Client.Get(ctx,
types.NamespacedName{Name: vsRef.Name, Namespace: vsRef.Namespace},
types.NamespacedName{Name: vsName, Namespace: pvc.Namespace},
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's better to look for volume snapshot by vs name and vs namespace? What if one day vs namespace will be different from pvc namespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

The VolumeGroupSnapshot status looks like this:

status:
  boundVolumeGroupSnapshotContentName: groupsnapcontent-66e442b9-d739-48cc-9158-a6472c3a2022
  creationTime: "2024-09-13T13:05:00Z"
  pvcVolumeSnapshotRefList:
  - persistentVolumeClaimRef:
      name: busybox-cg2-pvc1
    volumeSnapshotRef:
      name: snapshot-bc3b0f7a8da345fd3d423eebe43cf6023ad34b03d7ff1df3fdf227da330303e6-2024-09-13-1.5.0
  - persistentVolumeClaimRef:
      name: busybox-cg2-pvc2
    volumeSnapshotRef:
      name: snapshot-811a028ea7008016c74c082430686955ae178d56cc4f0fdc3e5394da2cc20a1f-2024-09-13-1.5.3
  readyToUse: true

We have only the names in the status. The snapshot is for the PVC and we already have the PVC for it. Therefore we use the PVC namespace. The PVC namespace is the same as the VolumeGroupSnapshot.

@ShyamsundarR
Copy link
Member

LGTM, requeued the unit test run before merge.

@ShyamsundarR ShyamsundarR merged commit c247950 into main Sep 17, 2024
36 of 38 checks passed
@BenamarMk BenamarMk deleted the upgrade-ramen-to-latest-snapshotter-crd branch January 27, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants