Skip to content

Commit 34ac86f

Browse files
sivakumar subraanisiva-portworx
authored andcommitted
pb-3633: fixed the v1/v1beta1 version call for volumesnapshot get in RestoreVolumeClaim()
1 parent b157feb commit 34ac86f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/snapshotter/snapshotter_csi.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,13 @@ func (c *csiDriver) RestoreVolumeClaim(opts ...Option) (*v1.PersistentVolumeClai
561561
pvc.Spec.VolumeName = ""
562562

563563
if c.v1SnapshotRequired {
564-
snapshot, err := c.snapshotClient.SnapshotV1beta1().VolumeSnapshots(o.RestoreNamespace).Get(context.TODO(), o.RestoreSnapshotName, metav1.GetOptions{})
564+
snapshot, err := c.snapshotClient.SnapshotV1().VolumeSnapshots(o.RestoreNamespace).Get(context.TODO(), o.RestoreSnapshotName, metav1.GetOptions{})
565565
if err != nil {
566566
return nil, fmt.Errorf("failed to get volumesnapshot %s/%s", o.RestoreNamespace, o.RestoreSnapshotName)
567567
}
568568

569569
checkVsStatus := func() (interface{}, bool, error) {
570-
snapshot, err = c.snapshotClient.SnapshotV1beta1().VolumeSnapshots(snapshot.Namespace).Get(context.TODO(), snapshot.Name, metav1.GetOptions{})
570+
snapshot, err = c.snapshotClient.SnapshotV1().VolumeSnapshots(snapshot.Namespace).Get(context.TODO(), snapshot.Name, metav1.GetOptions{})
571571
if err != nil {
572572
errMsg := fmt.Sprintf("failed to get volumesnapshot [%v/%v]", snapshot.Namespace, snapshot.Name)
573573
return "", true, fmt.Errorf("%v", errMsg)

0 commit comments

Comments
 (0)