Skip to content

Commit

Permalink
Merge pull request #5401 from shubham-pampattiwar/add-vsc-nil-check
Browse files Browse the repository at this point in the history
Add nil check before execution of csi snapshot delete
  • Loading branch information
sseago authored Oct 18, 2022
2 parents 9cb46de + 34cca77 commit 6b2cb7a
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 6b2cb7a

Please sign in to comment.