Skip to content

Commit

Permalink
During Failover pull VRG from s3 only from failover cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <elenage@il.ibm.com>
  • Loading branch information
ELENAGER committed Dec 10, 2023
1 parent 5637d0f commit aed5e77
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions controllers/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aed5e77

Please sign in to comment.