Skip to content

Commit

Permalink
Add unit tests for hub recovery
Browse files Browse the repository at this point in the history
Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
  • Loading branch information
Benamar Mekhissi committed Dec 22, 2023
1 parent f348ce1 commit ea6fdba
Show file tree
Hide file tree
Showing 3 changed files with 443 additions and 167 deletions.
2 changes: 1 addition & 1 deletion controllers/drcluster_mmode.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (u *drclusterInstance) mModeActivationsRequired() (map[string]ramen.Storage
vrgs, err := u.getVRGs(drpcCollection)
if err != nil {
u.log.Info("Failed to get VRGs for DRPC that is failing over",
"DRPCName", drpcCollection.drpc.GetName(),
"DRPCCommonName", drpcCollection.drpc.GetName(),
"DRPCNamespace", drpcCollection.drpc.GetNamespace())

u.requeue = true
Expand Down
4 changes: 2 additions & 2 deletions controllers/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func requiresRegionalFailoverPrerequisites(
ctx context.Context,
apiReader client.Reader,
s3ProfileNames []string,
drpcName string,
DRPCCommonName string,
vrgNamespace string,
vrgs map[string]*rmn.VolumeReplicationGroup,
failoverCluster string,
Expand All @@ -573,7 +573,7 @@ func requiresRegionalFailoverPrerequisites(

vrg := getLastKnownPrimaryVRG(vrgs, failoverCluster)
if vrg == nil {
vrg = GetLastKnownVRGPrimaryFromS3(ctx, apiReader, s3ProfileNames, drpcName, vrgNamespace, objectStoreGetter, log)
vrg = GetLastKnownVRGPrimaryFromS3(ctx, apiReader, s3ProfileNames, DRPCCommonName, 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
Loading

0 comments on commit ea6fdba

Please sign in to comment.