Skip to content

Commit

Permalink
Leftovervsc (#44)
Browse files Browse the repository at this point in the history
* Added image option to fio command

* order change of delete
  • Loading branch information
bathina2 authored Dec 16, 2020
1 parent 9cbe60d commit 72cca45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/csi/snapshot_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,13 @@ func (c *snapshotCreate) CreateFromSourceCheck(ctx context.Context, snapshotter
return err
}
targetSnapClassName := clonePrefix + args.VolumeSnapshotClass
defer func() {
_ = c.dynCli.Resource(v1alpha1.VolSnapClassGVR).Delete(ctx, targetSnapClassName, metav1.DeleteOptions{})
}()
err := snapshotter.CloneVolumeSnapshotClass(args.VolumeSnapshotClass, targetSnapClassName, kansnapshot.DeletionPolicyRetain, nil)
if err != nil {
return errors.Wrapf(err, "Failed to create a VolumeSnapshotClass to use to restore the snapshot")
}
defer func() {
_ = c.dynCli.Resource(v1alpha1.VolSnapClassGVR).Delete(ctx, targetSnapClassName, metav1.DeleteOptions{})
}()

snapSrc, err := snapshotter.GetSource(ctx, args.SnapshotName, args.Namespace)
if err != nil {
Expand Down

0 comments on commit 72cca45

Please sign in to comment.