Skip to content

Commit

Permalink
Add nil check before execution of csi snapshot delete
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Pampattiwar <[email protected]>

add changelog

Signed-off-by: Shubham Pampattiwar <[email protected]>
  • Loading branch information
shubham-pampattiwar committed Oct 18, 2022
1 parent 9cb46de commit 34cca77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelogs/unreleased/5401-shubham-pampattiwar
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add nil check before execution of csi snapshot delete
4 changes: 3 additions & 1 deletion pkg/controller/backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}

Expand Down

0 comments on commit 34cca77

Please sign in to comment.