Merge pull request #5217 from lilongfeng0902/lilf-branch

check vsc null pointer
This commit is contained in:
Xun Jiang/Bruce Jiang
2022-08-27 10:45:13 +08:00
committed by GitHub
2 changed files with 5 additions and 0 deletions
@@ -0,0 +1 @@
check vsc null pointer
+4
View File
@@ -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
}