Merge pull request #5401 from shubham-pampattiwar/add-vsc-nil-check

Add nil check before execution of csi snapshot delete
This commit is contained in:
Scott Seago
2022-10-18 15:24:16 -04:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -0,0 +1 @@
Add nil check before execution of csi snapshot delete

View File

@@ -707,7 +707,9 @@ func (c *backupController) runBackup(backup *pkgbackup.Request) error {
}
// Delete the VolumeSnapshots created in the backup, when CSI feature is enabled.
c.deleteVolumeSnapshot(volumeSnapshots, volumeSnapshotContents, *backup, backupLog)
if len(volumeSnapshots) > 0 && len(volumeSnapshotContents) > 0 {
c.deleteVolumeSnapshot(volumeSnapshots, volumeSnapshotContents, *backup, backupLog)
}
}