Skip to content

Commit 73fc4fc

Browse files
authored
Merge pull request #1294 from umagnus/use_gvs_uid_hash
fix: use voluegroupsnapshot uid to make snapshotname
2 parents 69023e5 + 508abdd commit 73fc4fc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/common-controller/groupsnapshot_controller_helper.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,10 @@ func (ctrl *csiSnapshotCommonController) createSnapshotsForGroupSnapshotContent(
554554
}
555555

556556
volumeSnapshotContentName := getSnapshotContentNameForVolumeGroupSnapshotContent(
557-
string(groupSnapshotContent.UID), volumeHandle)
557+
string(groupSnapshot.UID), volumeHandle)
558558

559559
volumeSnapshotName := getSnapshotNameForVolumeGroupSnapshotContent(
560-
string(groupSnapshotContent.UID), volumeHandle)
560+
string(groupSnapshot.UID), volumeHandle)
561561

562562
volumeSnapshotNamespace := groupSnapshotContent.Spec.VolumeGroupSnapshotRef.Namespace
563563

@@ -727,14 +727,14 @@ func (ctrl *csiSnapshotCommonController) findPersistentVolumeByCSIDriverHandle(d
727727
}
728728

729729
// getSnapshotNameForVolumeGroupSnapshotContent returns a unique snapshot name for a VolumeGroupSnapshotContent.
730-
func getSnapshotNameForVolumeGroupSnapshotContent(groupSnapshotContentUUID, volumeHandle string) string {
731-
return fmt.Sprintf("snapshot-%x", sha256.Sum256([]byte(groupSnapshotContentUUID+volumeHandle)))
730+
func getSnapshotNameForVolumeGroupSnapshotContent(groupSnapshotUUID, volumeHandle string) string {
731+
return fmt.Sprintf("snapshot-%x", sha256.Sum256([]byte(groupSnapshotUUID+volumeHandle)))
732732
}
733733

734734
// getSnapshotContentNameForVolumeGroupSnapshotContent returns a unique content name for the
735735
// passed in VolumeGroupSnapshotContent.
736-
func getSnapshotContentNameForVolumeGroupSnapshotContent(groupSnapshotContentUUID, volumeHandle string) string {
737-
return fmt.Sprintf("snapcontent-%x", sha256.Sum256([]byte(groupSnapshotContentUUID+volumeHandle)))
736+
func getSnapshotContentNameForVolumeGroupSnapshotContent(groupSnapshotUUID, volumeHandle string) string {
737+
return fmt.Sprintf("snapcontent-%x", sha256.Sum256([]byte(groupSnapshotUUID+volumeHandle)))
738738
}
739739

740740
// getPreprovisionedGroupSnapshotContentFromStore tries to find a pre-provisioned

0 commit comments

Comments
 (0)