From 050c0a6c2a436ba98cc8568c6a6ab96c8b86b9ef Mon Sep 17 00:00:00 2001 From: yati1998 Date: Thu, 26 Sep 2024 08:18:13 +0530 Subject: [PATCH] add check continue VGS deletion this commit adds check to continue deleting the volumegroupsnapshot in case there are no snapshotcontent found under that group. Signed-off-by: yati1998 --- pkg/sidecar-controller/groupsnapshot_helper.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/sidecar-controller/groupsnapshot_helper.go b/pkg/sidecar-controller/groupsnapshot_helper.go index 58c44f4ff..ca6d46276 100644 --- a/pkg/sidecar-controller/groupsnapshot_helper.go +++ b/pkg/sidecar-controller/groupsnapshot_helper.go @@ -251,6 +251,10 @@ func (ctrl *csiSnapshotSideCarController) deleteCSIGroupSnapshotOperation(groupS for _, contentRef := range groupSnapshotContent.Status.PVVolumeSnapshotContentList { snapshotContent, err := ctrl.contentLister.Get(contentRef.VolumeSnapshotContentRef.Name) if err != nil { + if errors.IsNotFound(err) { + klog.Infof("snapshot content %v not found", contentRef.VolumeSnapshotContentRef.Name) + continue + } return fmt.Errorf("failed to get snapshot content %s from snapshot content store: %v", contentRef.VolumeSnapshotContentRef.Name, err) } snapshotIDs = append(snapshotIDs, *snapshotContent.Status.SnapshotHandle)