From 23bba14ef3ca20183878bf7f3a5b358581f05b42 Mon Sep 17 00:00:00 2001 From: xing-yang Date: Mon, 23 Dec 2019 21:23:19 +0000 Subject: [PATCH] Address one more comment --- pkg/common-controller/snapshot_controller.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/common-controller/snapshot_controller.go b/pkg/common-controller/snapshot_controller.go index e345a903..8ba9b51c 100644 --- a/pkg/common-controller/snapshot_controller.go +++ b/pkg/common-controller/snapshot_controller.go @@ -235,7 +235,6 @@ func (ctrl *csiSnapshotCommonController) processIfDeletionTimestampSet(snapshot func (ctrl *csiSnapshotCommonController) checkandRemoveSnapshotFinalizersAndCheckandDeleteContent(snapshot *crdv1.VolumeSnapshot, content *crdv1.VolumeSnapshotContent, deleteContent bool) error { klog.V(5).Infof("checkandRemoveSnapshotFinalizersAndCheckandDeleteContent VolumeSnapshot[%s]: %s", utils.SnapshotKey(snapshot), utils.GetSnapshotStatusForLogging(snapshot)) - var err error // Check is snapshot deletionTimestamp is set and any finalizer is on if utils.IsSnapshotDeletionCandidate(snapshot) { // Volume snapshot should be deleted. Check if it's used @@ -258,7 +257,7 @@ func (ctrl *csiSnapshotCommonController) checkandRemoveSnapshotFinalizersAndChec } } - if !inUse || (content == nil && err == nil) { + if !inUse { klog.V(5).Infof("checkandRemoveSnapshotFinalizersAndCheckandDeleteContent: Remove Finalizer for VolumeSnapshot[%s]", utils.SnapshotKey(snapshot)) doesContentExist := false if content != nil {