Skip to content

Commit

Permalink
Return a valid cluster only if primary VRG is found during initial de…
Browse files Browse the repository at this point in the history
…ployment check

For initial deployment, when checking for deployed VRGs on the managed clusters,
only return the cluster if the primary VRG on it is found, otherwise, return 'not found'

Signed-off-by: Benamar Mekhissi <[email protected]>
  • Loading branch information
Benamar Mekhissi authored and ShyamsundarR committed Jun 13, 2024
1 parent 1cfa268 commit 126b5bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions controllers/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,15 @@ func (d *DRPCInstance) getCachedVRG(clusterName string) *rmn.VolumeReplicationGr
}

func (d *DRPCInstance) isVRGAlreadyDeployedElsewhere(clusterToSkip string) (string, bool) {
for clusterName := range d.vrgs {
for clusterName, vrg := range d.vrgs {
if clusterName == clusterToSkip {
continue
}

return clusterName, true
// We are checking for the initial deployment. Only return the cluster if the VRG on it is primary.
if isVRGPrimary(vrg) {
return clusterName, true
}
}

return "", false
Expand Down

0 comments on commit 126b5bd

Please sign in to comment.