From aed5e7748b43885c68f2cbec66f18b01325d53d6 Mon Sep 17 00:00:00 2001 From: Elena Gershkovich Date: Wed, 29 Nov 2023 15:54:07 +0200 Subject: [PATCH] During Failover pull VRG from s3 only from failover cluster Signed-off-by: Elena Gershkovich --- controllers/drplacementcontrol.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/controllers/drplacementcontrol.go b/controllers/drplacementcontrol.go index fe438dd1b..5babad20d 100644 --- a/controllers/drplacementcontrol.go +++ b/controllers/drplacementcontrol.go @@ -535,20 +535,23 @@ func (d *DRPCInstance) checkMetroFailoverPrerequisites(curHomeCluster string) (b func (d *DRPCInstance) checkRegionalFailoverPrerequisites() bool { d.setProgression(rmn.ProgressionWaitForStorageMaintenanceActivation) - if required, activationsRequired := requiresRegionalFailoverPrerequisites( - d.ctx, - d.reconciler.APIReader, - rmnutil.DRPolicyS3Profiles(d.drPolicy, d.drClusters).List(), - d.instance.GetName(), d.instance.GetNamespace(), - d.vrgs, d.instance.Spec.FailoverCluster, - d.reconciler.ObjStoreGetter, d.log); required { - for _, drCluster := range d.drClusters { - if drCluster.Name != d.instance.Spec.FailoverCluster { - continue - } + for _, drCluster := range d.drClusters { + if drCluster.Name != d.instance.Spec.FailoverCluster { + continue + } + // we want to work with failover cluster only, because the previous primary cluster might be unreachable + if required, activationsRequired := requiresRegionalFailoverPrerequisites( + d.ctx, + d.reconciler.APIReader, + []string{drCluster.Spec.S3ProfileName}, + d.instance.GetName(), d.instance.GetNamespace(), + d.vrgs, d.instance.Spec.FailoverCluster, + d.reconciler.ObjStoreGetter, d.log); required { return checkFailoverMaintenanceActivations(drCluster, activationsRequired, d.log) } + + break } return true