diff --git a/changelogs/unreleased/5401-shubham-pampattiwar b/changelogs/unreleased/5401-shubham-pampattiwar new file mode 100644 index 000000000..e42b5260c --- /dev/null +++ b/changelogs/unreleased/5401-shubham-pampattiwar @@ -0,0 +1 @@ +Add nil check before execution of csi snapshot delete \ No newline at end of file diff --git a/pkg/controller/backup_controller.go b/pkg/controller/backup_controller.go index c874201fd..900345b5e 100644 --- a/pkg/controller/backup_controller.go +++ b/pkg/controller/backup_controller.go @@ -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) + } }