Skip to content

Commit 00a501d

Browse files
author
oleksiys
committed
Use discovered storageclassName to look up the storage class.
1 parent 311f929 commit 00a501d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controller/snapshot_controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ func (ctrl *csiSnapshotController) getStorageClassFromVolumeSnapshot(snapshot *c
866866
if len(storageclassName) == 0 {
867867
return nil, fmt.Errorf("cannot figure out the snapshot class automatically, please specify one in snapshot spec")
868868
}
869-
storageclass, err := ctrl.client.StorageV1().StorageClasses().Get(*pvc.Spec.StorageClassName, metav1.GetOptions{})
869+
storageclass, err := ctrl.client.StorageV1().StorageClasses().Get(storageclassName, metav1.GetOptions{})
870870
if err != nil {
871871
return nil, err
872872
}

0 commit comments

Comments
 (0)