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 <[email protected]>
  • Loading branch information
ELENAGER committed Nov 29, 2023
1 parent 2271f38 commit a075fd6
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions controllers/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,19 +535,27 @@ 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
}
var drFailoverCluster *rmn.DRCluster

for _, drCluster := range d.drClusters {
if drCluster.Name != d.instance.Spec.FailoverCluster {
continue
}
drFailoverCluster = &drCluster

Check failure on line 544 in controllers/drplacementcontrol.go

View workflow job for this annotation

GitHub Actions / Golangci Lint

G601: Implicit memory aliasing in for loop. (gosec)

break
}

if drFailoverCluster != nil {
if required, activationsRequired := requiresRegionalFailoverPrerequisites(
d.ctx,
d.reconciler.APIReader,
rmnutil.DRPolicyS3Profiles(d.drPolicy, []rmn.DRCluster{*drFailoverCluster}).List(),
d.instance.GetName(), d.instance.GetNamespace(),
d.vrgs, d.instance.Spec.FailoverCluster,
d.reconciler.ObjStoreGetter, d.log); required {

Check failure on line 556 in controllers/drplacementcontrol.go

View workflow job for this annotation

GitHub Actions / Golangci Lint

unnecessary leading newline (whitespace)

Check failure on line 557 in controllers/drplacementcontrol.go

View workflow job for this annotation

GitHub Actions / Golangci Lint

File is not `gofumpt`-ed (gofumpt)
return checkFailoverMaintenanceActivations(drCluster, activationsRequired, d.log)
return checkFailoverMaintenanceActivations(*drFailoverCluster, activationsRequired, d.log)
}
}

Expand Down

0 comments on commit a075fd6

Please sign in to comment.