@@ -157,7 +157,8 @@ func (r *DRPolicyReconciler) reconcile(
157
157
// we will be able to validate conflicts only after PeerClass is updated
158
158
err := validatePolicyConflicts (u .ctx , r .APIReader , u .object , drclusters )
159
159
if err != nil {
160
- return ctrl.Result {}, fmt .Errorf ("%s: %w" , ReasonValidationFailed , err ) // we can change the message later.
160
+ return ctrl.Result {}, fmt .Errorf ("DRPolicy conflict found: %w" ,
161
+ u .validatedSetFalse ("DRPolicyConflictFound" , err ))
161
162
}
162
163
163
164
if err := u .validatedSetTrue ("Succeeded" , "drpolicy validated" ); err != nil {
@@ -295,7 +296,7 @@ func hasConflictingDRPolicy(match *ramen.DRPolicy, drclusters *ramen.DRClusterLi
295
296
296
297
// None of the common managed clusters should belong to Metro Regions in either of the drpolicies.
297
298
if haveOverlappingMetroZones (match , drp , drclusters ) {
298
- return fmt .Errorf ("drpolicy: %v has overlapping metro region with another drpolicy %v" , match .Name , drp .Name )
299
+ return fmt .Errorf ("drpolicy: %v has overlapping clusters with another drpolicy %v" , match .Name , drp .Name )
299
300
}
300
301
}
301
302
@@ -324,9 +325,9 @@ func getStorageIDsFromPeerClass(drpolicy *ramen.DRPolicy) []string {
324
325
return sids
325
326
}
326
327
327
- func hasCommonClusters (metroMap map [string ][]string , commonClusterIDs , commonClusters []string ) bool {
328
+ func hasCommonClusters (metroMap map [string ][]string , commonSIDs , commonClusters []string ) bool {
328
329
for _ , v := range metroMap {
329
- if sets .NewString (v ... ).HasAny (commonClusterIDs ... ) {
330
+ if sets .NewString (v ... ).HasAny (commonSIDs ... ) {
330
331
return true
331
332
}
332
333
0 commit comments