Skip to content

Commit

Permalink
Fix one place where drpcNamespace is used instead of vrgNamespace whe…
Browse files Browse the repository at this point in the history
…n using AppSet

Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
  • Loading branch information
Benamar Mekhissi committed Dec 20, 2023
1 parent 1107ea6 commit 72f7af9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 11 additions & 1 deletion controllers/drcluster_mmode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions controllers/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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?
Expand Down

0 comments on commit 72f7af9

Please sign in to comment.