Skip to content

Commit

Permalink
adjust code order
Browse files Browse the repository at this point in the history
  • Loading branch information
李龙峰 committed Aug 18, 2022
1 parent e38635c commit bd70913
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/controller/backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -951,12 +951,13 @@ func (c *backupController) deleteVolumeSnapshot(volumeSnapshots []*snapshotv1api
if vs.Status.BoundVolumeSnapshotContentName != nil &&
len(*vs.Status.BoundVolumeSnapshotContentName) > 0 {
vsc = vscMap[*vs.Status.BoundVolumeSnapshotContentName]
if nil != vsc && vsc.Spec.DeletionPolicy == snapshotv1api.VolumeSnapshotContentDelete {
modifyVSCFlag = true
} else {
if nil != vsc {
logger.Errorf("Not find %s from the vscMap", vs.Status.BoundVolumeSnapshotContentName)
return
}
if vsc.Spec.DeletionPolicy == snapshotv1api.VolumeSnapshotContentDelete {
modifyVSCFlag = true
}
}

// Change VolumeSnapshotContent's DeletionPolicy to Retain before deleting VolumeSnapshot,
Expand Down

0 comments on commit bd70913

Please sign in to comment.