Modify the volume helper logic.

Signed-off-by: Xun Jiang <blackpigletbruce@gmail.com>
This commit is contained in:
Xun Jiang
2024-05-15 10:11:22 +08:00
parent 49eab81807
commit a91d2cb036
23 changed files with 925 additions and 834 deletions

View File

@@ -504,11 +504,6 @@ func (b *backupReconciler) validateAndGetSnapshotLocations(backup *velerov1api.B
errors := []string{}
providerLocations := make(map[string]*velerov1api.VolumeSnapshotLocation)
// if snapshotVolume is set to false then we don't need to validate volumesnapshotlocation
if boolptr.IsSetToFalse(backup.Spec.SnapshotVolumes) {
return nil, nil
}
for _, locationName := range backup.Spec.VolumeSnapshotLocations {
// validate each locationName exists as a VolumeSnapshotLocation
location := &velerov1api.VolumeSnapshotLocation{}