From c5542748331cc365feb4d509fee6e5677a087ee3 Mon Sep 17 00:00:00 2001 From: Christian Huffman Date: Wed, 21 Apr 2021 13:23:16 -0400 Subject: [PATCH] Correct snapshotContent error propagation --- pkg/sidecar-controller/snapshot_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sidecar-controller/snapshot_controller.go b/pkg/sidecar-controller/snapshot_controller.go index b43c929b..0e2a98f0 100644 --- a/pkg/sidecar-controller/snapshot_controller.go +++ b/pkg/sidecar-controller/snapshot_controller.go @@ -300,8 +300,8 @@ func (ctrl *csiSnapshotSideCarController) createSnapshotWrapper(content *crdv1.V // storage system has responded with an error klog.Infof("createSnapshotWrapper: CreateSnapshot for content %s returned error: %v", content.Name, err) if isCSIFinalError(err) { - if err := ctrl.removeAnnVolumeSnapshotBeingCreated(content); err != nil { - return nil, fmt.Errorf("failed to remove VolumeSnapshotBeingCreated annotation from the content %s: %s", content.Name, err) + if removeAnnotationErr := ctrl.removeAnnVolumeSnapshotBeingCreated(content); removeAnnotationErr != nil { + return nil, fmt.Errorf("failed to remove VolumeSnapshotBeingCreated annotation from the content %s: %s", content.Name, removeAnnotationErr) } }