Merge pull request #5303 from qiuming-best/issue-5217

check vsc null pointer
This commit is contained in:
qiuming
2022-09-07 16:34:04 +08:00
committed by GitHub
2 changed files with 5 additions and 0 deletions
@@ -0,0 +1 @@
check vsc null pointer
+4
View File
@@ -940,6 +940,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
}