Skip to content

Commit

Permalink
Merge pull request #1115 from leonardoce/fix-vgs
Browse files Browse the repository at this point in the history
Look for a VolumeGroupSnapshotClass when getting the class of a VolumeGroupSnapshot
  • Loading branch information
k8s-ci-robot authored Aug 26, 2024
2 parents aca6768 + 1226227 commit 723dc22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/common-controller/groupsnapshot_controller_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ func (ctrl *csiSnapshotCommonController) removeGroupSnapshotFinalizer(groupSnaps
// getGroupSnapshotDriverName is a helper function to get driver from the VolumeGroupSnapshot.
// We try to get the driverName in multiple ways, as snapshot controller metrics depend on the correct driverName.
func (ctrl *csiSnapshotCommonController) getGroupSnapshotDriverName(vgs *crdv1alpha1.VolumeGroupSnapshot) (string, error) {
klog.V(5).Infof("getSnapshotDriverName: VolumeSnapshot[%s]", vgs.Name)
klog.V(5).Infof("getGroupSnapshotDriverName: VolumeGroupSnapshot[%s]", vgs.Name)
var driverName string

// Pre-Provisioned groupsnapshots have contentName as source
Expand All @@ -1396,9 +1396,9 @@ func (ctrl *csiSnapshotCommonController) getGroupSnapshotDriverName(vgs *crdv1al

// Dynamic groupsnapshots will have a groupsnapshotclass with a driver
if vgs.Spec.VolumeGroupSnapshotClassName != nil {
class, err := ctrl.getSnapshotClass(*vgs.Spec.VolumeGroupSnapshotClassName)
class, err := ctrl.getGroupSnapshotClass(*vgs.Spec.VolumeGroupSnapshotClassName)
if err != nil {
klog.Errorf("getGroupSnapshotDriverName: failed to get groupsnapshotClass: %v", *vgs.Spec.VolumeGroupSnapshotClassName)
klog.Errorf("getGroupSnapshotDriverName: failed to get groupSnapshotClass: %v", *vgs.Spec.VolumeGroupSnapshotClassName)
} else {
driverName = class.Driver
}
Expand Down

0 comments on commit 723dc22

Please sign in to comment.