Skip to content

Block conflicting MirrorPeer pairs before topology Pair cluster action - #1

Draft
TimothyAsirJeyasing wants to merge 1 commit into
release-4.23from
cursor/mirror-peer-pair-validation-5b76
Draft

Block conflicting MirrorPeer pairs before topology Pair cluster action#1
TimothyAsirJeyasing wants to merge 1 commit into
release-4.23from
cursor/mirror-peer-pair-validation-5b76

Conversation

@TimothyAsirJeyasing

Copy link
Copy Markdown
Owner

Summary

Closes the 4.23 gap where verifyMirrorPeerExistence only ran during Create DRPolicy form validation, not before the topology Pair cluster action.

  • Extracts verifyMirrorPeerExistence, checkSyncPolicyExists, and hasConflictingPeering into a shared utility (cluster-peering-validators.ts) used by both the Create DRPolicy wizard and topology.
  • Topology Pair cluster flow: disables conflicting targets in the context menu submenu and blocks opening the pair modal with the same error message used in the form.
  • Reuse behavior preserved: same pair (A+B when A+B MirrorPeer exists) remains allowed.

Behavior

Existing MirrorPeer User selects Result
A + C A + B Blocked (conflict)
A + B A + B Allowed (reuse)
None A + B Allowed (create)

Testing

  • Added unit tests in cluster-peering-validators.spec.ts (8 cases, all passing)
  • Covers conflict detection, reuse allowance, and sync DRPolicy duplicate check

Not in scope

MCO backend create-time validation for CLI/API bypass remains unchanged (optional hardening for a follow-up).

Open in Web Open in Cursor 

Extract verifyMirrorPeerExistence and related checks into a shared
cluster-peering-validators utility used by both the Create DRPolicy form
and the topology Pair cluster flow.

The topology context menu now disables targets that would conflict with an
existing MirrorPeer or sync DRPolicy, and opening the pair modal is blocked
with the same error message shown during DR policy creation. Reuse of an
existing identical pair remains allowed.

Co-authored-by: Timothy <tjeyasin@redhat.com>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f3e61f61-368c-4e39-8605-920af49df69e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/mirror-peer-pair-validation-5b76

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants