From dcf760d5f19e44e83839b19b7c7a5f56ff386dc3 Mon Sep 17 00:00:00 2001 From: Lyndon-Li Date: Fri, 12 Apr 2024 10:21:33 +0800 Subject: [PATCH] issue 7648:avoid snapshot leak on expose failure Signed-off-by: Lyndon-Li --- changelogs/unreleased/7662-Lyndon-Li | 1 + pkg/util/csi/volume_snapshot_test.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/7662-Lyndon-Li diff --git a/changelogs/unreleased/7662-Lyndon-Li b/changelogs/unreleased/7662-Lyndon-Li new file mode 100644 index 0000000000..536dd2dcfb --- /dev/null +++ b/changelogs/unreleased/7662-Lyndon-Li @@ -0,0 +1 @@ +Fix issue #7648. Adjust the exposing logic to avoid exposing failure and snapshot leak when expose fails \ No newline at end of file diff --git a/pkg/util/csi/volume_snapshot_test.go b/pkg/util/csi/volume_snapshot_test.go index 74be22786e..a8200291ac 100644 --- a/pkg/util/csi/volume_snapshot_test.go +++ b/pkg/util/csi/volume_snapshot_test.go @@ -626,8 +626,7 @@ func TestRetainVSC(t *testing.T) { clientObj: []runtime.Object{vscObj}, updated: &snapshotv1api.VolumeSnapshotContent{ ObjectMeta: metav1.ObjectMeta{ - Name: "fake-vsc", - Finalizers: []string{volumeSnapshotContentProtectFinalizer}, + Name: "fake-vsc", }, Spec: snapshotv1api.VolumeSnapshotContentSpec{ DeletionPolicy: snapshotv1api.VolumeSnapshotContentRetain,