Skip to content

Commit

Permalink
Merge pull request #5217 from lilongfeng0902/lilf-branch
Browse files Browse the repository at this point in the history
check vsc null pointer
  • Loading branch information
blackpiglet authored Aug 27, 2022
2 parents 8d3f173 + 5cddaea commit 86762f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/5217-lilongfeng0902
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
check vsc null pointer
4 changes: 4 additions & 0 deletions pkg/controller/backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,10 @@ func (c *backupController) deleteVolumeSnapshot(volumeSnapshots []*snapshotv1api
if vs.Status.BoundVolumeSnapshotContentName != nil &&
len(*vs.Status.BoundVolumeSnapshotContentName) > 0 {
vsc = vscMap[*vs.Status.BoundVolumeSnapshotContentName]
if nil == vsc {
logger.Errorf("Not find %s from the vscMap", vs.Status.BoundVolumeSnapshotContentName)
return
}
if vsc.Spec.DeletionPolicy == snapshotv1api.VolumeSnapshotContentDelete {
modifyVSCFlag = true
}
Expand Down

0 comments on commit 86762f4

Please sign in to comment.