Delete orphan CSI snapshots in backup sync controller

This commit makes backup sync controller delete the volumesnapshot and
volumesnapshotcontent created by the backup which is cleaned up as orphan

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
This commit is contained in:
Daniel Jiang
2022-05-05 10:54:34 +08:00
parent 001229a8b3
commit 89e90d9be4
7 changed files with 44 additions and 4 deletions
@@ -344,6 +344,7 @@ func TestBackupSyncControllerRun(t *testing.T) {
fakeClient,
client.VeleroV1(),
sharedInformers.Velero().V1().Backups().Lister(),
nil, // csiVSLister
time.Duration(0),
test.namespace,
nil, // csiSnapshotClient
@@ -565,6 +566,7 @@ func TestDeleteOrphanedBackups(t *testing.T) {
fakeClient,
client.VeleroV1(),
sharedInformers.Velero().V1().Backups().Lister(),
nil, // csiVSLister
time.Duration(0),
test.namespace,
nil, // csiSnapshotClient
@@ -659,6 +661,7 @@ func TestStorageLabelsInDeleteOrphanedBackups(t *testing.T) {
fakeClient,
client.VeleroV1(),
sharedInformers.Velero().V1().Backups().Lister(),
nil, // csiVSLister
time.Duration(0),
test.namespace,
nil, // csiSnapshotClient