Skip to content

Commit de6c35a

Browse files
authored
Merge pull request #470 from timoreimann/retain-create-snapshot-error
Retain CreateSnapshot error
2 parents cbe212e + b31a29f commit de6c35a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkg/sidecar-controller/snapshot_controller.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,12 @@ func (ctrl *csiSnapshotSideCarController) createSnapshotWrapper(content *crdv1.V
300300
// storage system has responded with an error
301301
klog.Infof("createSnapshotWrapper: CreateSnapshot for content %s returned error: %v", content.Name, err)
302302
if isCSIFinalError(err) {
303-
err = ctrl.removeAnnVolumeSnapshotBeingCreated(content)
304-
if err != nil {
305-
return nil, fmt.Errorf("failed to remove VolumeSnapshotBeingCreated annotation from the content %s: %q", content.Name, err)
303+
if err := ctrl.removeAnnVolumeSnapshotBeingCreated(content); err != nil {
304+
return nil, fmt.Errorf("failed to remove VolumeSnapshotBeingCreated annotation from the content %s: %s", content.Name, err)
306305
}
307306
}
308307

309-
return nil, fmt.Errorf("failed to take snapshot of the volume, %s: %q", *content.Spec.Source.VolumeHandle, err)
308+
return nil, fmt.Errorf("failed to take snapshot of the volume %s: %q", *content.Spec.Source.VolumeHandle, err)
310309
}
311310

312311
klog.V(5).Infof("Created snapshot: driver %s, snapshotId %s, creationTime %v, size %d, readyToUse %t", driverName, snapshotID, creationTime, size, readyToUse)

0 commit comments

Comments
 (0)