diff --git a/controllers/drcluster_mmode.go b/controllers/drcluster_mmode.go index 83bea1fb8..57d1b8d19 100644 --- a/controllers/drcluster_mmode.go +++ b/controllers/drcluster_mmode.go @@ -70,12 +70,22 @@ func (u *drclusterInstance) mModeActivationsRequired() (map[string]ramen.Storage continue } + placementObj, err := getPlacementOrPlacementRule(u.ctx, u.client, drpcCollection.drpc, u.log) + if err != nil { + return nil, err + } + + vrgNamespace, err := selectVRGNamespace(u.client, u.log, drpcCollection.drpc, placementObj) + if err != nil { + return nil, err + } + required, activationsRequired := requiresRegionalFailoverPrerequisites( u.ctx, u.reconciler.APIReader, []string{u.object.Spec.S3ProfileName}, drpcCollection.drpc.GetName(), - drpcCollection.drpc.GetNamespace(), + vrgNamespace, vrgs, u.object.GetName(), u.reconciler.ObjectStoreGetter, diff --git a/controllers/drplacementcontrol.go b/controllers/drplacementcontrol.go index 5253c29a0..391ba68f4 100644 --- a/controllers/drplacementcontrol.go +++ b/controllers/drplacementcontrol.go @@ -538,7 +538,7 @@ func (d *DRPCInstance) checkRegionalFailoverPrerequisites() bool { d.ctx, d.reconciler.APIReader, []string{drCluster.Spec.S3ProfileName}, - d.instance.GetName(), d.instance.GetNamespace(), + d.instance.GetName(), d.vrgNamespace, d.vrgs, d.instance.Spec.FailoverCluster, d.reconciler.ObjStoreGetter, d.log); required { return checkFailoverMaintenanceActivations(drCluster, activationsRequired, d.log) @@ -558,7 +558,7 @@ func requiresRegionalFailoverPrerequisites( apiReader client.Reader, s3ProfileNames []string, drpcName string, - drpcNamespace string, + vrgNamespace string, vrgs map[string]*rmn.VolumeReplicationGroup, failoverCluster string, objectStoreGetter ObjectStoreGetter, @@ -571,7 +571,7 @@ func requiresRegionalFailoverPrerequisites( vrg := getLastKnownPrimaryVRG(vrgs, failoverCluster) if vrg == nil { - vrg = GetLastKnownVRGPrimaryFromS3(ctx, apiReader, s3ProfileNames, drpcName, drpcNamespace, objectStoreGetter, log) + vrg = GetLastKnownVRGPrimaryFromS3(ctx, apiReader, s3ProfileNames, drpcName, vrgNamespace, objectStoreGetter, log) if vrg == nil { // TODO: Is this an error, should we ensure at least one VRG is found in the edge cases? // Potentially missing VRG and so stop failover? How to recover in that case?