Skip to content

[management] Prevent deletion of peers linked to network routers #3881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 29, 2025

Conversation

bcmmbaga
Copy link
Contributor

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

@Copilot Copilot AI review requested due to automatic review settings May 26, 2025 15:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a safeguard to prevent deleting peers that are linked to network routers.

  • Imports router types and implements a helper to check router linkage
  • Invokes the new check in validatePeerDelete to block deletions when linked
Comments suppressed due to low confidence (1)

management/server/peer.go:1557

  • There are no tests covering the new router-linkage check in validatePeerDelete. Add unit tests to verify deletion is blocked when a peer is linked to a router and allowed otherwise.
linked, router := isPeerLinkedToNetworkRouter(ctx, am.Store, accountId, peerId)

@bcmmbaga bcmmbaga force-pushed the prevent-router-peer-deletion branch from f061558 to 79f45ab Compare May 26, 2025 15:39
Copy link

@bcmmbaga bcmmbaga merged commit 684501f into main May 29, 2025
35 checks passed
@bcmmbaga bcmmbaga deleted the prevent-router-peer-deletion branch May 29, 2025 15:50
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