Skip to content

Commit

Permalink
simplify expression
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai committed Aug 11, 2023
1 parent 7349db5 commit 3c0365c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions controllers/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ func (r *DPAReconciler) ValidateDataProtectionCR(log logr.Logger) (bool, error)
if location.Velero != nil && location.Velero.ObjectStorage != nil && location.Velero.ObjectStorage.Prefix == "" && dpa.BackupImages() {
return false, errors.New("BackupLocation must have velero prefix when backupImages is set to true")
}
if location.CloudStorage != nil {
if location.CloudStorage.Prefix == "" && dpa.BackupImages() {
return false, errors.New("BackupLocation must have cloud storage prefix when backupImages is not set to false")
}
if location.CloudStorage != nil && location.CloudStorage.Prefix == "" && dpa.BackupImages() {
return false, errors.New("BackupLocation must have cloud storage prefix when backupImages is not set to false")
}
}

Expand Down

0 comments on commit 3c0365c

Please sign in to comment.